From 0f7ad97ac3dcf9aa98e7e3c3e21f8201e9ef788e Mon Sep 17 00:00:00 2001 From: Guillaume Roger Date: Wed, 15 Nov 2023 10:21:02 +0100 Subject: [PATCH 1/4] Pydantic v2 in poetry Signed-off-by: Guillaume Roger --- poetry.lock | 195 ++++++++++++++++++++++++++++++++++++------------- pyproject.toml | 2 +- 2 files changed, 144 insertions(+), 53 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7c533499..1bcdca0f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,15 @@ -# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. + +[[package]] +name = "annotated-types" +version = "0.6.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, +] [[package]] name = "binaryornot" @@ -638,13 +649,13 @@ test = ["pytest (>=6)"] [[package]] name = "fastjsonschema" -version = "2.18.1" +version = "2.19.0" description = "Fastest Python implementation of JSON schema" optional = false python-versions = "*" files = [ - {file = "fastjsonschema-2.18.1-py3-none-any.whl", hash = "sha256:aec6a19e9f66e9810ab371cc913ad5f4e9e479b63a7072a2cd060a9369e329a8"}, - {file = "fastjsonschema-2.18.1.tar.gz", hash = "sha256:06dc8680d937628e993fa0cd278f196d20449a1adc087640710846b324d422ea"}, + {file = "fastjsonschema-2.19.0-py3-none-any.whl", hash = "sha256:b9fd1a2dd6971dbc7fee280a95bd199ae0dd9ce22beb91cc75e9c1c528a5170e"}, + {file = "fastjsonschema-2.19.0.tar.gz", hash = "sha256:e25df6647e1bc4a26070b700897b07b542ec898dd4f1f6ea013e7f6a88417225"}, ] [package.extras] @@ -1625,55 +1636,135 @@ files = [ [[package]] name = "pydantic" -version = "1.10.13" -description = "Data validation and settings management using python type hints" +version = "2.5.0" +description = "Data validation using Python type hints" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.13-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:efff03cc7a4f29d9009d1c96ceb1e7a70a65cfe86e89d34e4a5f2ab1e5693737"}, - {file = "pydantic-1.10.13-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3ecea2b9d80e5333303eeb77e180b90e95eea8f765d08c3d278cd56b00345d01"}, - {file = "pydantic-1.10.13-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1740068fd8e2ef6eb27a20e5651df000978edce6da6803c2bef0bc74540f9548"}, - {file = "pydantic-1.10.13-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:84bafe2e60b5e78bc64a2941b4c071a4b7404c5c907f5f5a99b0139781e69ed8"}, - {file = "pydantic-1.10.13-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bc0898c12f8e9c97f6cd44c0ed70d55749eaf783716896960b4ecce2edfd2d69"}, - {file = "pydantic-1.10.13-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:654db58ae399fe6434e55325a2c3e959836bd17a6f6a0b6ca8107ea0571d2e17"}, - {file = "pydantic-1.10.13-cp310-cp310-win_amd64.whl", hash = "sha256:75ac15385a3534d887a99c713aa3da88a30fbd6204a5cd0dc4dab3d770b9bd2f"}, - {file = "pydantic-1.10.13-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c553f6a156deb868ba38a23cf0df886c63492e9257f60a79c0fd8e7173537653"}, - {file = "pydantic-1.10.13-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:5e08865bc6464df8c7d61439ef4439829e3ab62ab1669cddea8dd00cd74b9ffe"}, - {file = "pydantic-1.10.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e31647d85a2013d926ce60b84f9dd5300d44535a9941fe825dc349ae1f760df9"}, - {file = "pydantic-1.10.13-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:210ce042e8f6f7c01168b2d84d4c9eb2b009fe7bf572c2266e235edf14bacd80"}, - {file = "pydantic-1.10.13-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8ae5dd6b721459bfa30805f4c25880e0dd78fc5b5879f9f7a692196ddcb5a580"}, - {file = "pydantic-1.10.13-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f8e81fc5fb17dae698f52bdd1c4f18b6ca674d7068242b2aff075f588301bbb0"}, - {file = "pydantic-1.10.13-cp311-cp311-win_amd64.whl", hash = "sha256:61d9dce220447fb74f45e73d7ff3b530e25db30192ad8d425166d43c5deb6df0"}, - {file = "pydantic-1.10.13-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4b03e42ec20286f052490423682016fd80fda830d8e4119f8ab13ec7464c0132"}, - {file = "pydantic-1.10.13-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f59ef915cac80275245824e9d771ee939133be38215555e9dc90c6cb148aaeb5"}, - {file = "pydantic-1.10.13-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5a1f9f747851338933942db7af7b6ee8268568ef2ed86c4185c6ef4402e80ba8"}, - {file = "pydantic-1.10.13-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:97cce3ae7341f7620a0ba5ef6cf043975cd9d2b81f3aa5f4ea37928269bc1b87"}, - {file = "pydantic-1.10.13-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:854223752ba81e3abf663d685f105c64150873cc6f5d0c01d3e3220bcff7d36f"}, - {file = "pydantic-1.10.13-cp37-cp37m-win_amd64.whl", hash = "sha256:b97c1fac8c49be29486df85968682b0afa77e1b809aff74b83081cc115e52f33"}, - {file = "pydantic-1.10.13-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c958d053453a1c4b1c2062b05cd42d9d5c8eb67537b8d5a7e3c3032943ecd261"}, - {file = "pydantic-1.10.13-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4c5370a7edaac06daee3af1c8b1192e305bc102abcbf2a92374b5bc793818599"}, - {file = "pydantic-1.10.13-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d6f6e7305244bddb4414ba7094ce910560c907bdfa3501e9db1a7fd7eaea127"}, - {file = "pydantic-1.10.13-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3a3c792a58e1622667a2837512099eac62490cdfd63bd407993aaf200a4cf1f"}, - {file = "pydantic-1.10.13-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:c636925f38b8db208e09d344c7aa4f29a86bb9947495dd6b6d376ad10334fb78"}, - {file = "pydantic-1.10.13-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:678bcf5591b63cc917100dc50ab6caebe597ac67e8c9ccb75e698f66038ea953"}, - {file = "pydantic-1.10.13-cp38-cp38-win_amd64.whl", hash = "sha256:6cf25c1a65c27923a17b3da28a0bdb99f62ee04230c931d83e888012851f4e7f"}, - {file = "pydantic-1.10.13-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8ef467901d7a41fa0ca6db9ae3ec0021e3f657ce2c208e98cd511f3161c762c6"}, - {file = "pydantic-1.10.13-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:968ac42970f57b8344ee08837b62f6ee6f53c33f603547a55571c954a4225691"}, - {file = "pydantic-1.10.13-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9849f031cf8a2f0a928fe885e5a04b08006d6d41876b8bbd2fc68a18f9f2e3fd"}, - {file = "pydantic-1.10.13-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56e3ff861c3b9c6857579de282ce8baabf443f42ffba355bf070770ed63e11e1"}, - {file = "pydantic-1.10.13-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f00790179497767aae6bcdc36355792c79e7bbb20b145ff449700eb076c5f96"}, - {file = "pydantic-1.10.13-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:75b297827b59bc229cac1a23a2f7a4ac0031068e5be0ce385be1462e7e17a35d"}, - {file = "pydantic-1.10.13-cp39-cp39-win_amd64.whl", hash = "sha256:e70ca129d2053fb8b728ee7d1af8e553a928d7e301a311094b8a0501adc8763d"}, - {file = "pydantic-1.10.13-py3-none-any.whl", hash = "sha256:b87326822e71bd5f313e7d3bfdc77ac3247035ac10b0c0618bd99dcf95b1e687"}, - {file = "pydantic-1.10.13.tar.gz", hash = "sha256:32c8b48dcd3b2ac4e78b0ba4af3a2c2eb6048cb75202f0ea7b34feb740efc340"}, + {file = "pydantic-2.5.0-py3-none-any.whl", hash = "sha256:7ce6e766c456ad026fe5712f7bcf036efc34bd5d107b3e669ef7ea01b3a9050c"}, + {file = "pydantic-2.5.0.tar.gz", hash = "sha256:69bd6fb62d2d04b7055f59a396993486a2ee586c43a0b89231ce0000de07627c"}, ] [package.dependencies] -typing-extensions = ">=4.2.0" +annotated-types = ">=0.4.0" +pydantic-core = "2.14.1" +typing-extensions = ">=4.6.1" [package.extras] -dotenv = ["python-dotenv (>=0.10.4)"] -email = ["email-validator (>=1.0.3)"] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.14.1" +description = "" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pydantic_core-2.14.1-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:812beca1dcb2b722cccc7e9c620bd972cbc323321194ec2725eab3222e6ac573"}, + {file = "pydantic_core-2.14.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a2ccdc53cb88e51c7d47d74c59630d7be844428f6b8d463055ffad6f0392d8da"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd937733bf2fe7d6a8bf208c12741f1f730b7bf5636033877767a75093c29b8a"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:581bb606a31749a00796f5257947a0968182d7fe91e1dada41f06aeb6bfbc91a"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aadf74a40a7ae49c3c1aa7d32334fe94f4f968e21dd948e301bb4ed431fb2412"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b89821a2c77cc1b8f2c1fc3aacd6a3ecc5df8f7e518dc3f18aef8c4dcf66003d"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49ee28d65f506b2858a60745cc974ed005298ebab12693646b97641dd7c99c35"}, + {file = "pydantic_core-2.14.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:97246f896b4df7fd84caa8a75a67abb95f94bc0b547665bf0889e3262b060399"}, + {file = "pydantic_core-2.14.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:1185548665bc61bbab0dc78f10c8eafa0db0aa1e920fe9a451b77782b10a65cc"}, + {file = "pydantic_core-2.14.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2a7d08b39fac97540fba785fce3b21ee01a81f081a07a4d031efd791da6666f9"}, + {file = "pydantic_core-2.14.1-cp310-none-win32.whl", hash = "sha256:0a8c8daf4e3aa3aeb98e3638fc3d58a359738f3d12590b2474c6bb64031a0764"}, + {file = "pydantic_core-2.14.1-cp310-none-win_amd64.whl", hash = "sha256:4f0788699a92d604f348e9c1ac5e97e304e97127ba8325c7d0af88dcc7d35bd3"}, + {file = "pydantic_core-2.14.1-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:2be018a84995b6be1bbd40d6064395dbf71592a981169cf154c0885637f5f54a"}, + {file = "pydantic_core-2.14.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fc3227408808ba7df8e95eb1d8389f4ba2203bed8240b308de1d7ae66d828f24"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42d5d0e9bbb50481a049bd0203224b339d4db04006b78564df2b782e2fd16ebc"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bc6a4ea9f88a810cb65ccae14404da846e2a02dd5c0ad21dee712ff69d142638"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d312ad20e3c6d179cb97c42232b53111bcd8dcdd5c1136083db9d6bdd489bc73"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:679cc4e184f213c8227862e57340d12fd4d4d19dc0e3ddb0f653f86f01e90f94"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:101df420e954966868b8bc992aefed5fa71dd1f2755104da62ee247abab28e2f"}, + {file = "pydantic_core-2.14.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c964c0cc443d6c08a2347c0e5c1fc2d85a272dc66c1a6f3cde4fc4843882ada4"}, + {file = "pydantic_core-2.14.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:8276bbab68a9dbe721da92d19cbc061f76655248fe24fb63969d0c3e0e5755e7"}, + {file = "pydantic_core-2.14.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:12163197fec7c95751a3c71b36dcc1909eed9959f011ffc79cc8170a6a74c826"}, + {file = "pydantic_core-2.14.1-cp311-none-win32.whl", hash = "sha256:b8ff0302518dcd001bd722bbe342919c29e5066c7eda86828fe08cdc112668b8"}, + {file = "pydantic_core-2.14.1-cp311-none-win_amd64.whl", hash = "sha256:59fa83873223f856d898452c6162a390af4297756f6ba38493a67533387d85d9"}, + {file = "pydantic_core-2.14.1-cp311-none-win_arm64.whl", hash = "sha256:798590d38c9381f07c48d13af1f1ef337cebf76ee452fcec5deb04aceced51c7"}, + {file = "pydantic_core-2.14.1-cp312-cp312-macosx_10_7_x86_64.whl", hash = "sha256:587d75aec9ae50d0d63788cec38bf13c5128b3fc1411aa4b9398ebac884ab179"}, + {file = "pydantic_core-2.14.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:26242e3593d4929123615bd9365dd86ef79b7b0592d64a96cd11fd83c69c9f34"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5879ac4791508d8f0eb7dec71ff8521855180688dac0c55f8c99fc4d1a939845"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ad9ea86f5fc50f1b62c31184767fe0cacaa13b54fe57d38898c3776d30602411"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:102ac85a775e77821943ae38da9634ddd774b37a8d407181b4f7b05cdfb36b55"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2459cc06572730e079ec1e694e8f68c99d977b40d98748ae72ff11ef21a56b0b"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:217dcbfaf429a9b8f1d54eb380908b9c778e78f31378283b30ba463c21e89d5d"}, + {file = "pydantic_core-2.14.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9d59e0d7cdfe8ed1d4fcd28aad09625c715dc18976c7067e37d8a11b06f4be3e"}, + {file = "pydantic_core-2.14.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e2be646a5155d408e68b560c0553e8a83dc7b9f90ec6e5a2fc3ff216719385db"}, + {file = "pydantic_core-2.14.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:ffba979801e3931a19cd30ed2049450820effe8f152aaa317e2fd93795d318d7"}, + {file = "pydantic_core-2.14.1-cp312-none-win32.whl", hash = "sha256:132b40e479cb5cebbbb681f77aaceabbc8355df16c9124cff1d4060ada83cde2"}, + {file = "pydantic_core-2.14.1-cp312-none-win_amd64.whl", hash = "sha256:744b807fe2733b6da3b53e8ad93e8b3ea3ee3dfc3abece4dd2824cc1f39aa343"}, + {file = "pydantic_core-2.14.1-cp312-none-win_arm64.whl", hash = "sha256:24ba48f9d0b8d64fc5e42e1600366c3d7db701201294989aebdaca23110c02ab"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:ba55d73a2df4771b211d0bcdea8b79454980a81ed34a1d77a19ddcc81f98c895"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:e905014815687d88cbb14bbc0496420526cf20d49f20606537d87646b70f1046"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:443dc5eede7fa76b2370213e0abe881eb17c96f7d694501853c11d5d56916602"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:abae6fd5504e5e438e4f6f739f8364fd9ff5a5cdca897e68363e2318af90bc28"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9486e27bb3f137f33e2315be2baa0b0b983dae9e2f5f5395240178ad8e644728"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:69df82892ff00491d673b1929538efb8c8d68f534fdc6cb7fd3ac8a5852b9034"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:184ff7b30c3f60e1b775378c060099285fd4b5249271046c9005f8b247b39377"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3d5b2a4b3c10cad0615670cab99059441ff42e92cf793a0336f4bc611e895204"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:871c641a83719caaa856a11dcc61c5e5b35b0db888e1a0d338fe67ce744575e2"}, + {file = "pydantic_core-2.14.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:1e7208946ea9b27a8cef13822c339d4ae96e45952cc01fc4a91c7f1cb0ae2861"}, + {file = "pydantic_core-2.14.1-cp37-none-win32.whl", hash = "sha256:b4ff385a525017f5adf6066d7f9fb309f99ade725dcf17ed623dc7dce1f85d9f"}, + {file = "pydantic_core-2.14.1-cp37-none-win_amd64.whl", hash = "sha256:c7411cd06afeb263182e38c6ca5b4f5fe4f20d91466ad7db0cd6af453a02edec"}, + {file = "pydantic_core-2.14.1-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:2871daf5b2823bf77bf7d3d43825e5d904030c155affdf84b21a00a2e00821d2"}, + {file = "pydantic_core-2.14.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7977e261cac5f99873dc2c6f044315d09b19a71c4246560e1e67593889a90978"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5a111f9158555582deadd202a60bd7803b6c68f406391b7cf6905adf0af6811"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ac417312bf6b7a0223ba73fb12e26b2854c93bf5b1911f7afef6d24c379b22aa"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c36987f5eb2a7856b5f5feacc3be206b4d1852a6ce799f6799dd9ffb0cba56ae"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c6e98227eb02623d57e1fd061788837834b68bb995a869565211b9abf3de4bf4"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:023b6d7ec4e97890b28eb2ee24413e69a6d48de4e8b75123957edd5432f4eeb3"}, + {file = "pydantic_core-2.14.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6015beb28deb5306049ecf2519a59627e9e050892927850a884df6d5672f8c7d"}, + {file = "pydantic_core-2.14.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3f48d4afd973abbd65266ac24b24de1591116880efc7729caf6b6b94a9654c9e"}, + {file = "pydantic_core-2.14.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:28734bcfb8fc5b03293dec5eb5ea73b32ff767f6ef79a31f6e41dad2f5470270"}, + {file = "pydantic_core-2.14.1-cp38-none-win32.whl", hash = "sha256:3303113fdfaca927ef11e0c5f109e2ec196c404f9d7ba5f8ddb63cdf287ea159"}, + {file = "pydantic_core-2.14.1-cp38-none-win_amd64.whl", hash = "sha256:144f2c1d5579108b6ed1193fcc9926124bd4142b0f7020a7744980d1235c8a40"}, + {file = "pydantic_core-2.14.1-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:893bf4fb9bfb9c4639bc12f3de323325ada4c6d60e478d5cded65453e9364890"}, + {file = "pydantic_core-2.14.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:052d8731aaf844f91fe4cd3faf28983b109a5865b3a256ec550b80a5689ead87"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb1c6ecb53e4b907ee8486f453dd940b8cbb509946e2b671e3bf807d310a96fc"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:94cf6d0274eb899d39189144dcf52814c67f9b0fd196f211420d9aac793df2da"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:36c3bf96f803e207a80dbcb633d82b98ff02a9faa76dd446e969424dec8e2b9f"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fb290491f1f0786a7da4585250f1feee200fc17ff64855bdd7c42fb54526fa29"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6590ed9d13eb51b28ea17ddcc6c8dbd6050b4eb589d497105f0e13339f223b72"}, + {file = "pydantic_core-2.14.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:69cd74e55a5326d920e7b46daa2d81c2bdb8bcf588eafb2330d981297b742ddc"}, + {file = "pydantic_core-2.14.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d965bdb50725a805b083f5f58d05669a85705f50a6a864e31b545c589290ee31"}, + {file = "pydantic_core-2.14.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ca942a2dc066ca5e04c27feaa8dfb9d353ddad14c6641660c565149186095343"}, + {file = "pydantic_core-2.14.1-cp39-none-win32.whl", hash = "sha256:72c2ef3787c3b577e5d6225d73a77167b942d12cef3c1fbd5e74e55b7f881c36"}, + {file = "pydantic_core-2.14.1-cp39-none-win_amd64.whl", hash = "sha256:55713d155da1e508083c4b08d0b1ad2c3054f68b8ef7eb3d3864822e456f0bb5"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-macosx_10_7_x86_64.whl", hash = "sha256:53efe03cc383a83660cfdda6a3cb40ee31372cedea0fde0b2a2e55e838873ab6"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:f523e116879bc6714e61d447ce934676473b068069dce6563ea040381dc7a257"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85bb66d661be51b2cba9ca06759264b3469d2dbb53c3e6effb3f05fec6322be6"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f53a3ccdc30234cb4342cec541e3e6ed87799c7ca552f0b5f44e3967a5fed526"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:1bfb63821ada76719ffcd703fc40dd57962e0d8c253e3c565252e6de6d3e0bc6"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e2c689439f262c29cf3fcd5364da1e64d8600facecf9eabea8643b8755d2f0de"}, + {file = "pydantic_core-2.14.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:a15f6e5588f7afb7f6fc4b0f4ff064749e515d34f34c666ed6e37933873d8ad8"}, + {file = "pydantic_core-2.14.1-pp37-pypy37_pp73-macosx_10_7_x86_64.whl", hash = "sha256:f1a30eef060e21af22c7d23349f1028de0611f522941c80efa51c05a63142c62"}, + {file = "pydantic_core-2.14.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:16f4a7e1ec6b3ea98a1e108a2739710cd659d68b33fbbeaba066202cab69c7b6"}, + {file = "pydantic_core-2.14.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fd80a2d383940eec3db6a5b59d1820f947317acc5c75482ff8d79bf700f8ad6a"}, + {file = "pydantic_core-2.14.1-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a68a36d71c7f638dda6c9e6b67f6aabf3fa1471b198d246457bfdc7c777cdeb7"}, + {file = "pydantic_core-2.14.1-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:ebc79120e105e4bcd7865f369e3b9dbabb0d492d221e1a7f62a3e8e292550278"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-macosx_10_7_x86_64.whl", hash = "sha256:c8c466facec2ccdf025b0b1455b18f2c3d574d5f64d24df905d3d7b8f05d5f4e"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:b91b5ec423e88caa16777094c4b2b97f11453283e7a837e5e5e1b886abba1251"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:130e49aa0cb316f743bc7792c36aefa39fc2221312f1d4b333b19edbdd71f2b1"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f483467c046f549572f8aca3b7128829e09ae3a9fe933ea421f7cb7c58120edb"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:dee4682bd7947afc682d342a8d65ad1834583132383f8e801601a8698cb8d17a"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:8d927d042c0ef04607ee7822828b208ab045867d20477ec6593d612156798547"}, + {file = "pydantic_core-2.14.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:5a1570875eb0d1479fb2270ed80c88c231aaaf68b0c3f114f35e7fb610435e4f"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-macosx_10_7_x86_64.whl", hash = "sha256:cb2fd3ab67558eb16aecfb4f2db4febb4d37dc74e6b8613dc2e7160fb58158a9"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:a7991f25b98038252363a03e6a9fe92e60fe390fda2631d238dc3b0e396632f8"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5b45b7be9f99991405ecd6f6172fb6798908a8097106ae78d5cc5cc15121bad9"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:51506e7652a2ef1d1cf763c4b51b972ff4568d1dddc96ca83931a6941f5e6389"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:66dc0e63349ec39c1ea66622aa5c2c1f84382112afd3ab2fa0cca4fb01f7db39"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:8e17f0c3ba4cb07faa0038a59ce162de584ed48ba645c8d05a5de1e40d4c21e7"}, + {file = "pydantic_core-2.14.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:d983222223f63e323a5f497f5b85e211557a5d8fb670dc88f343784502b466ba"}, + {file = "pydantic_core-2.14.1.tar.gz", hash = "sha256:0d82a6ee815388a362885186e431fac84c7a06623bc136f508e9f88261d8cadb"}, +] + +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" [[package]] name = "pyparsing" @@ -2119,24 +2210,24 @@ files = [ [[package]] name = "tomlkit" -version = "0.12.2" +version = "0.12.3" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" files = [ - {file = "tomlkit-0.12.2-py3-none-any.whl", hash = "sha256:eeea7ac7563faeab0a1ed8fe12c2e5a51c61f933f2502f7e9db0241a65163ad0"}, - {file = "tomlkit-0.12.2.tar.gz", hash = "sha256:df32fab589a81f0d7dc525a4267b6d7a64ee99619cbd1eeb0fae32c1dd426977"}, + {file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"}, + {file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"}, ] [[package]] name = "trove-classifiers" -version = "2023.11.13" +version = "2023.11.14" description = "Canonical source for classifiers on PyPI (pypi.org)." optional = false python-versions = "*" files = [ - {file = "trove-classifiers-2023.11.13.tar.gz", hash = "sha256:87d8599d890b719c81c7e33cdb2813d5965e5958984bff1b913e161f0d6a5286"}, - {file = "trove_classifiers-2023.11.13-py3-none-any.whl", hash = "sha256:5b09dd4114d2ea30928561fbb656724ea5e2b19f97b2c8c3699ac22e4e971958"}, + {file = "trove-classifiers-2023.11.14.tar.gz", hash = "sha256:64b5e78305a5de347f2cd7ec8c12d704a3ef0cb85cc10c0ca5f73488d1c201f8"}, + {file = "trove_classifiers-2023.11.14-py3-none-any.whl", hash = "sha256:2893a80cf3c48645462dea97c72c02a9fb1f7bd3c65f9908d3ffb1a7ef0b3833"}, ] [[package]] @@ -2321,4 +2412,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "c44795ad8ea26220e7d96774b654431467f01995d18d784944d0321f020aeffc" +content-hash = "4f4110de30994ac06ef4cfc7a01e613b46db987f5058943f31aae931388c49a7" diff --git a/pyproject.toml b/pyproject.toml index e060e994..e6364bb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ exclude = ["./pycgmes/shacl"] [tool.poetry.dependencies] python = "^3.10" poetry = ">=1.5.0" # key 'priority' in source -pydantic = "<2" # Used for dataclasses, v2 is quite new and needs more stability before migration +pydantic = ">=2" # Used for dataclasses [tool.poetry.group.dev.dependencies] black = "*" # Formatter From 09bdd483098039e3f9157ecebc158e8c4609585d Mon Sep 17 00:00:00 2001 From: Guillaume Roger Date: Wed, 15 Nov 2023 14:57:04 +0100 Subject: [PATCH 2/4] Upgrade to pydantic V2, everything except resources Signed-off-by: Guillaume Roger --- CONTRIBUTING.md | 2 +- README.md | 42 ++++++++------- SConstruct.py | 6 +-- pycgmes/utils/base.py | 20 ++++--- .../utils/{dataclassconfig.py => config.py} | 15 +++--- pycgmes/utils/constants.py | 12 ++--- pyproject.toml | 6 +-- tests/test_bay.py | 6 +-- tests/test_custom_attrs.py | 52 ++++++++++++------- tests/test_custom_profile.py | 20 ++++--- 10 files changed, 101 insertions(+), 80 deletions(-) rename pycgmes/utils/{dataclassconfig.py => config.py} (50%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ef90b021..ffc98dbe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -117,7 +117,7 @@ the work. For more information see the Code review guideline. ## Style guide -We use black, pylint, ruff, mypy, pytest and coverage to enforce good quality. +We use black, ruff, pyright, pytest and coverage to enforce good quality. They are all checked via Github actions, and can be run locally (after installing the dev dependency of the project) with `scons all`. Look at the [workflow](.github/workflows/_core.yaml) to see the specific steps. diff --git a/README.md b/README.md index 370e99b4..e0651036 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ If this is a leaf node (for instance `ACLineSegment`), it "just works". If you w class higher in the hierarchy (for instance `Equipment`) there is a lot more work to do. ```python -@dataclass(config=DataclassConfig) +@dataclass class CustomBay(Bay): colour: str = Field( default="Red", @@ -98,15 +98,15 @@ class CustomProfile(BaseProfile): And use it everywhere you would use a profile: ```python -from pycgmes.utils.dataclassconfig import DataclassConfig - -@dataclass(config=DataclassConfig) +@dataclass class CustomBayAttr(Bay): colour: str = Field( default="Red", - in_profiles=[ - CustomProfile.CUS, - ], + json_schema_extra={ + "in_profiles": [ + CustomProfile.CUS, + ], + } ) # And for instance: @@ -124,10 +124,9 @@ In the case of a custom attribute defined via a sub class, the result would be: from pydantic.dataclasses import dataclass from pycgmes.resources.ACLineSegment import ACLineSegment -from pycgmes.utils.dataclassconfig import DataclassConfig -@dataclass(config=DataclassConfig) +@dataclass class ACLineSegmentCustom(ACLineSegment): @classmethod def apparent_name(cls): @@ -157,28 +156,31 @@ from pydantic.dataclasses import dataclass from pydantic import Field from pycgmes.resources import ACLineSegment -from pycgmes.resources.Base import DataclassConfig, Profile -@dataclass(config=DataclassConfig) +@dataclass class ACLineSegmentCustom(ACLineSegment): colour: str = Field( default="Red", - in_profiles=[ - Profile.EQ, # Do not do this, see chapter "create a new profile" - ], - namespace="custom", + json_schema_extra={ + "in_profiles": [ + Profile.EQ, # Do not do this, see chapter "create a new profile" + ], + "namespace": "custom", + }, ) size: str = Field( default="Big", - in_profiles=[ - Profile.EQ, # Do not do this, see chapter "create a new profile" - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, # Do not do this, see chapter "create a new profile" + ], + } ) @property - def namesapce(self) -> str: + def namespace(self) -> str: return "custom ns class" @classmethod @@ -225,7 +227,7 @@ Generated from the modernpython serialisation of [cimgen](https://github.com/sog The CI happens in GitHub actions. -The standard black/mypy/autoflake/isort/pylint/ruff/mypy are run there, via scons. +The standard black/pyright/ruff are run there, via scons. ### CD diff --git a/SConstruct.py b/SConstruct.py index c4404308..d024d361 100644 --- a/SConstruct.py +++ b/SConstruct.py @@ -72,12 +72,8 @@ def _exec(command: str, env: Mapping | None = None) -> int: if "lock" in COMMAND_LINE_TARGETS: _exec("poetry check --lock") -if "lint" in COMMAND_LINE_TARGETS or "lint" in COMMAND_LINE_TARGETS: - _exec(f"pylint --rcfile=pyproject.toml {_SUBJECT}") - if "type" in COMMAND_LINE_TARGETS or "pyright" in COMMAND_LINE_TARGETS: - # https://mypy.readthedocs.io/en/stable/running_mypy.html#library-stubs-not-installed _exec("pyright", env=os.environ) _target_found = True @@ -96,6 +92,8 @@ def _exec(command: str, env: Mapping | None = None) -> int: _exec("coverage report --show-missing") if "license" in COMMAND_LINE_TARGETS or "licence" in COMMAND_LINE_TARGETS: + # To fix: + # reuse annotate --copyright="Alliander" --license=Apache-2.0 --recursive pycgmes/{resources,utils} _exec("reuse lint") if not _target_found: diff --git a/pycgmes/utils/base.py b/pycgmes/utils/base.py index 569f6045..03551381 100644 --- a/pycgmes/utils/base.py +++ b/pycgmes/utils/base.py @@ -12,16 +12,19 @@ from pycgmes.utils.constants import NAMESPACES -from .dataclassconfig import DataclassConfig +from ..utils.config import cgmes_resource_config from .profile import BaseProfile -@dataclass(config=DataclassConfig) +@dataclass class Base: """ - Base Class for pylint . + Base Class for resources. """ + # Will be inherited in subclasses. + model_config = cgmes_resource_config + @cached_property def possible_profiles(self) -> set[BaseProfile]: raise NotImplementedError("Method not implemented because not relevant in Base.") @@ -92,9 +95,12 @@ def cgmes_attribute_names_in_profile(self, profile: BaseProfile | None) -> set[F return { f for f in fields(self) - # The field is defined as a pydantic.Field, not a dataclass.field, - # so access to metadata is a tad different. Furthermore, mypy is confused by extra. - if (profile is None or profile in f.default.extra["in_profiles"]) # type: ignore[union-attr] + # The field is defined as a pydantic. Field, not a dataclass.field, + # so access to metadata is a tad different. Furthermore, pyright is confused by extra. + if ( + profile is None + or (profile in f.default.json_schema_extra["in_profiles"]) # pyright: ignore[reportGeneralTypeIssues] + ) if f.name != "mRID" } @@ -125,7 +131,7 @@ def cgmes_attributes_in_profile(self, profile: BaseProfile | None) -> dict[str, # Namespace finding # "class namespace" means the first namespace defined in the inheritance tree. # This can go up to Base, which will give the default cim NS. - if (extra := getattr(f.default, "extra", None)) is None: + if (extra := getattr(f.default, "json_schema_extra", None)) is None: # The attribute does not have extra metadata. It might be a custom atttribute # without it, or a base type (int...). # Use the class namespace. diff --git a/pycgmes/utils/dataclassconfig.py b/pycgmes/utils/config.py similarity index 50% rename from pycgmes/utils/dataclassconfig.py rename to pycgmes/utils/config.py index d2b16562..476425bc 100644 --- a/pycgmes/utils/dataclassconfig.py +++ b/pycgmes/utils/config.py @@ -2,15 +2,14 @@ # # SPDX-License-Identifier: Apache-2.0 +from pydantic import ConfigDict -class DataclassConfig: # pylint: disable=too-few-public-methods - """ - Used to configure pydantic dataclasses. - - See doc at - https://docs.pydantic.dev/latest/usage/model_config/#options - """ +# Used to configure pydantic dataclasses. +# See doc at +# https://docs.pydantic.dev/latest/usage/model_config/#options +cgmes_resource_config: ConfigDict = { # By default, with pydantic extra arguments given to a dataclass are silently ignored. # This matches the default behaviour by failing noisily. - extra = "forbid" + "extra": "forbid" +} diff --git a/pycgmes/utils/constants.py b/pycgmes/utils/constants.py index 7bdb2b30..e6102ade 100644 --- a/pycgmes/utils/constants.py +++ b/pycgmes/utils/constants.py @@ -3,10 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 # Default namespaces used by CGMES. -NAMESPACES = { - "cim": "http://iec.ch/TC57/CIM100#", - "entsoe": "http://entsoe.eu/CIM/SchemaExtension/3/1#", - "md": "http://iec.ch/TC57/61970-552/ModelDescription/1#", - "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", - "xsd": "http://www.w3.org/2001/XMLSchema#", +NAMESPACES = { # Those are strings, not real addresses, hence the NOSONAR. + "cim": "http://iec.ch/TC57/CIM100#", # NOSONAR + "entsoe": "http://entsoe.eu/CIM/SchemaExtension/3/1#", # NOSONAR + "md": "http://iec.ch/TC57/61970-552/ModelDescription/1#", # NOSONAR + "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#", # NOSONAR + "xsd": "http://www.w3.org/2001/XMLSchema#", # NOSONAR } diff --git a/pyproject.toml b/pyproject.toml index e6364bb1..59ee8034 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ [tool.poetry] name = "pycgmes" -version = "1.1.0" +version = "2.0.0" description = "Python dataclasses for CGMES 3.0.0" authors = ["pycgmes "] readme = "README.md" @@ -36,7 +36,7 @@ black = "*" # Formatter coverage = { extras = ["toml"], version = "*" } # unit test coverage pyright = "*" # replaces mypy reuse = "*" # Check licence headers -ruff = "*" # Linter/fixer. Replaces isort and autoflake, eventually probably pylint as well. +ruff = "*" # Linter/fixer. Replaces isort autoflake and pylint pytest = "*" SCons = "*" # Command runner @@ -71,7 +71,7 @@ exclude_also = [ # Regexp of lines (or first line of block) which do not count f ] [tool.pyright] -include = ["src"] +include = ["pycgmes"] exclude = ["tests"] # Simulate mypy - these vars will always have the value defined here during type checks defineConstant = { TYPE_CHECKING = true } diff --git a/tests/test_bay.py b/tests/test_bay.py index d0e5a12f..f626e4c9 100644 --- a/tests/test_bay.py +++ b/tests/test_bay.py @@ -20,7 +20,7 @@ class TestBay: def test_load_bay(self): - b = Bay() + Bay() def test_bay_has_mrid(self): b = Bay() @@ -70,10 +70,6 @@ def test_bay_has_expected_profiles(self): def test_bay_has_expected_attributes(self, profile, attribute_names): assert attribute_names == {a.name for a in Bay().cgmes_attribute_names_in_profile(Profile[profile])} - def test_param_casting(self): - # An int is castable to string, and it happens. - assert Bay(VoltageLevel=42).VoltageLevel == "42" - def test_param_validation(self): # mRID is not allowed to be None with pytest.raises(ValidationError): diff --git a/tests/test_custom_attrs.py b/tests/test_custom_attrs.py index 84d85873..fc6caa1b 100644 --- a/tests/test_custom_attrs.py +++ b/tests/test_custom_attrs.py @@ -8,20 +8,23 @@ from pycgmes.resources.Bay import Bay from pycgmes.utils.base import Base +from pycgmes.utils.config import cgmes_resource_config from pycgmes.utils.constants import NAMESPACES -from pycgmes.utils.dataclassconfig import DataclassConfig from pycgmes.utils.profile import Profile -@dataclass(config=DataclassConfig) +@dataclass class CustomBay(Bay): + model_config = cgmes_resource_config # Extends Bay. Has a lot of inherited fields. colour: str = Field( default="Red", - in_profiles=[ - Profile.EQ, - ], - namespace="custom", + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ], + "namespace": "custom", + }, ) @classmethod @@ -29,15 +32,18 @@ def apparent_name(cls): return "Bay" -@dataclass(config=DataclassConfig) +@dataclass class CustomBase(Base): + model_config = cgmes_resource_config # Extends Base. Has no inherited fields. Says its Bay. colour: str = Field( default="Red", - in_profiles=[ - Profile.EQ, - ], - namespace="custom", + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ], + "namespace": "custom", + }, ) @classmethod @@ -45,29 +51,35 @@ def apparent_name(cls): return "Bay" -@dataclass(config=DataclassConfig) +@dataclass class CustomButNotmuch(Base): + model_config = cgmes_resource_config # Extends Base. No inherited fields. Not namespace defined anywhere. colour: str = Field( default="Red", - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, # no namespace ) # no apparent_name() -@dataclass(config=DataclassConfig) +@dataclass class CustomNS(Base): + model_config = cgmes_resource_config # Extends Base. No inherited fields. NS only defined at class level, but will be # used by the attribute. colour: str = Field( default="Red", - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, # no namespace ) @@ -93,6 +105,8 @@ def test_customisation(self, klass, num_attrs, apparent, ns): colour = "cheese" cust = klass(colour=colour) attrs = cust.cgmes_attributes_in_profile(None) + print("PLOP") + print(attrs) assert len(attrs) == num_attrs assert f"{apparent}.colour" in attrs assert attrs[f"{apparent}.colour"]["value"] == colour diff --git a/tests/test_custom_profile.py b/tests/test_custom_profile.py index 7d7f8d7e..4957869c 100644 --- a/tests/test_custom_profile.py +++ b/tests/test_custom_profile.py @@ -6,23 +6,27 @@ from pydantic.dataclasses import dataclass from pycgmes.resources.Bay import Bay -from pycgmes.utils.dataclassconfig import DataclassConfig +from pycgmes.utils.config import cgmes_resource_config from pycgmes.utils.profile import BaseProfile class CustomProfile(BaseProfile): CUS = "Tom" FRO = "Mage" + model_config = cgmes_resource_config -@dataclass(config=DataclassConfig) +@dataclass class CustomBayAttr(Bay): + model_config = cgmes_resource_config colour: str = Field( default="Red", - in_profiles=[ - CustomProfile.CUS, - ], - namespace="custom", + json_schema_extra={ + "in_profiles": [ + CustomProfile.CUS, + ], + "namespace": "custom", + }, ) @classmethod @@ -30,8 +34,10 @@ def apparent_name(cls): return "Bay" -@dataclass(config=DataclassConfig) +@dataclass class CustomBayClass(Bay): + model_config = cgmes_resource_config + @classmethod def apparent_name(cls): return "Cheese" From 760c370467182ceb215379a79c4d763b51397afd Mon Sep 17 00:00:00 2001 From: Guillaume Roger Date: Wed, 15 Nov 2023 14:57:15 +0100 Subject: [PATCH 3/4] Upgrade resources to pydantic V2 Signed-off-by: Guillaume Roger --- pycgmes/resources/ACDCConverter.py | 167 +++--- pycgmes/resources/ACDCConverterDCTerminal.py | 19 +- pycgmes/resources/ACDCTerminal.py | 35 +- pycgmes/resources/ACLineSegment.py | 83 +-- pycgmes/resources/Accumulator.py | 11 +- pycgmes/resources/AccumulatorLimit.py | 19 +- pycgmes/resources/AccumulatorLimitSet.py | 15 +- pycgmes/resources/AccumulatorReset.py | 11 +- pycgmes/resources/AccumulatorValue.py | 15 +- pycgmes/resources/ActivePower.py | 51 +- pycgmes/resources/ActivePowerLimit.py | 19 +- .../resources/ActivePowerPerCurrentFlow.py | 27 +- pycgmes/resources/ActivePowerPerFrequency.py | 27 +- pycgmes/resources/Analog.py | 19 +- pycgmes/resources/AnalogControl.py | 27 +- pycgmes/resources/AnalogLimit.py | 19 +- pycgmes/resources/AnalogLimitSet.py | 15 +- pycgmes/resources/AnalogValue.py | 15 +- pycgmes/resources/AngleDegrees.py | 57 +- pycgmes/resources/AngleRadians.py | 27 +- pycgmes/resources/ApparentPower.py | 39 +- pycgmes/resources/ApparentPowerLimit.py | 19 +- pycgmes/resources/Area.py | 27 +- pycgmes/resources/AsynchronousMachine.py | 87 +-- .../resources/AsynchronousMachineDynamics.py | 23 +- .../AsynchronousMachineEquivalentCircuit.py | 43 +- pycgmes/resources/AsynchronousMachineKind.py | 3 +- ...synchronousMachineTimeConstantReactance.py | 43 +- .../AsynchronousMachineUserDefined.py | 15 +- pycgmes/resources/AuxiliaryEquipment.py | 11 +- pycgmes/resources/BaseVoltage.py | 29 +- pycgmes/resources/BasicIntervalSchedule.py | 27 +- pycgmes/resources/BatteryStateKind.py | 3 +- pycgmes/resources/BatteryUnit.py | 27 +- pycgmes/resources/Bay.py | 13 +- pycgmes/resources/Boolean.py | 3 +- pycgmes/resources/BoundaryPoint.py | 93 +-- pycgmes/resources/Breaker.py | 3 +- pycgmes/resources/BusNameMarker.py | 23 +- pycgmes/resources/BusbarSection.py | 11 +- pycgmes/resources/CAESPlant.py | 7 +- pycgmes/resources/CSCDynamics.py | 11 +- pycgmes/resources/CSCUserDefined.py | 15 +- pycgmes/resources/Capacitance.py | 27 +- pycgmes/resources/Clamp.py | 19 +- pycgmes/resources/CogenerationPlant.py | 7 +- pycgmes/resources/CombinedCyclePlant.py | 7 +- pycgmes/resources/Command.py | 35 +- pycgmes/resources/Conductance.py | 33 +- pycgmes/resources/ConductingEquipment.py | 19 +- pycgmes/resources/Conductor.py | 11 +- pycgmes/resources/ConformLoad.py | 11 +- pycgmes/resources/ConformLoadGroup.py | 11 +- pycgmes/resources/ConformLoadSchedule.py | 11 +- pycgmes/resources/ConnectivityNode.py | 29 +- .../resources/ConnectivityNodeContainer.py | 11 +- pycgmes/resources/Connector.py | 3 +- pycgmes/resources/Control.py | 51 +- pycgmes/resources/ControlArea.py | 43 +- .../resources/ControlAreaGeneratingUnit.py | 19 +- pycgmes/resources/ControlAreaTypeKind.py | 3 +- pycgmes/resources/CoordinateSystem.py | 15 +- .../CrossCompoundTurbineGovernorDynamics.py | 19 +- pycgmes/resources/CsConverter.py | 119 ++-- pycgmes/resources/CsOperatingModeKind.py | 3 +- pycgmes/resources/CsPpccControlKind.py | 3 +- pycgmes/resources/Currency.py | 3 +- pycgmes/resources/CurrentFlow.py | 45 +- pycgmes/resources/CurrentLimit.py | 19 +- pycgmes/resources/CurrentTransformer.py | 3 +- pycgmes/resources/Curve.py | 39 +- pycgmes/resources/CurveData.py | 35 +- pycgmes/resources/CurveStyle.py | 3 +- pycgmes/resources/Cut.py | 19 +- pycgmes/resources/DCBaseTerminal.py | 19 +- pycgmes/resources/DCBreaker.py | 3 +- pycgmes/resources/DCBusbar.py | 3 +- pycgmes/resources/DCChopper.py | 3 +- pycgmes/resources/DCConductingEquipment.py | 15 +- .../resources/DCConverterOperatingModeKind.py | 3 +- pycgmes/resources/DCConverterUnit.py | 19 +- pycgmes/resources/DCDisconnector.py | 3 +- pycgmes/resources/DCEquipmentContainer.py | 11 +- pycgmes/resources/DCGround.py | 19 +- pycgmes/resources/DCLine.py | 11 +- pycgmes/resources/DCLineSegment.py | 35 +- pycgmes/resources/DCNode.py | 23 +- pycgmes/resources/DCPolarityKind.py | 3 +- pycgmes/resources/DCSeriesDevice.py | 19 +- pycgmes/resources/DCShunt.py | 19 +- pycgmes/resources/DCSwitch.py | 3 +- pycgmes/resources/DCTerminal.py | 11 +- pycgmes/resources/DCTopologicalIsland.py | 11 +- pycgmes/resources/DCTopologicalNode.py | 23 +- pycgmes/resources/Date.py | 3 +- pycgmes/resources/DateTime.py | 3 +- pycgmes/resources/DayType.py | 7 +- pycgmes/resources/Decimal.py | 3 +- pycgmes/resources/Diagram.py | 55 +- pycgmes/resources/DiagramObject.py | 75 ++- pycgmes/resources/DiagramObjectGluePoint.py | 7 +- pycgmes/resources/DiagramObjectPoint.py | 51 +- pycgmes/resources/DiagramObjectStyle.py | 7 +- pycgmes/resources/DiagramStyle.py | 7 +- pycgmes/resources/DiscExcContIEEEDEC1A.py | 147 +++-- pycgmes/resources/DiscExcContIEEEDEC2A.py | 43 +- pycgmes/resources/DiscExcContIEEEDEC3A.py | 19 +- .../resources/DisconnectingCircuitBreaker.py | 3 +- pycgmes/resources/Disconnector.py | 3 +- .../DiscontinuousExcitationControlDynamics.py | 15 +- ...scontinuousExcitationControlUserDefined.py | 15 +- pycgmes/resources/Discrete.py | 15 +- pycgmes/resources/DiscreteValue.py | 15 +- pycgmes/resources/DroopSignalFeedbackKind.py | 3 +- pycgmes/resources/DynamicsFunctionBlock.py | 11 +- pycgmes/resources/EarthFaultCompensator.py | 11 +- pycgmes/resources/EnergyArea.py | 7 +- pycgmes/resources/EnergyConnection.py | 3 +- pycgmes/resources/EnergyConsumer.py | 67 ++- pycgmes/resources/EnergySchedulingType.py | 7 +- pycgmes/resources/EnergySource.py | 115 ++-- pycgmes/resources/Equipment.py | 41 +- pycgmes/resources/EquipmentContainer.py | 7 +- pycgmes/resources/EquivalentBranch.py | 131 +++-- pycgmes/resources/EquivalentEquipment.py | 11 +- pycgmes/resources/EquivalentInjection.py | 131 +++-- pycgmes/resources/EquivalentNetwork.py | 7 +- pycgmes/resources/EquivalentShunt.py | 19 +- pycgmes/resources/ExcAC1A.py | 179 +++--- pycgmes/resources/ExcAC2A.py | 227 +++++--- pycgmes/resources/ExcAC3A.py | 211 ++++--- pycgmes/resources/ExcAC4A.py | 75 ++- pycgmes/resources/ExcAC5A.py | 147 +++-- pycgmes/resources/ExcAC6A.py | 187 +++--- pycgmes/resources/ExcAC8B.py | 219 ++++--- pycgmes/resources/ExcANS.py | 115 ++-- pycgmes/resources/ExcAVR1.py | 99 ++-- pycgmes/resources/ExcAVR2.py | 107 ++-- pycgmes/resources/ExcAVR3.py | 99 ++-- pycgmes/resources/ExcAVR4.py | 115 ++-- pycgmes/resources/ExcAVR5.py | 27 +- pycgmes/resources/ExcAVR7.py | 171 +++--- pycgmes/resources/ExcBBC.py | 91 +-- pycgmes/resources/ExcCZ.py | 83 +-- pycgmes/resources/ExcDC1A.py | 147 +++-- pycgmes/resources/ExcDC2A.py | 147 +++-- pycgmes/resources/ExcDC3A.py | 131 +++-- pycgmes/resources/ExcDC3A1.py | 115 ++-- pycgmes/resources/ExcELIN1.py | 123 ++-- pycgmes/resources/ExcELIN2.py | 219 ++++--- pycgmes/resources/ExcHU.py | 99 ++-- pycgmes/resources/ExcIEEEAC1A.py | 147 +++-- pycgmes/resources/ExcIEEEAC2A.py | 171 +++--- pycgmes/resources/ExcIEEEAC3A.py | 171 +++--- pycgmes/resources/ExcIEEEAC4A.py | 75 ++- pycgmes/resources/ExcIEEEAC5A.py | 115 ++-- pycgmes/resources/ExcIEEEAC6A.py | 179 +++--- pycgmes/resources/ExcIEEEAC7B.py | 211 ++++--- pycgmes/resources/ExcIEEEAC8B.py | 147 +++-- pycgmes/resources/ExcIEEEDC1A.py | 131 +++-- pycgmes/resources/ExcIEEEDC2A.py | 131 +++-- pycgmes/resources/ExcIEEEDC3A.py | 91 +-- pycgmes/resources/ExcIEEEDC4B.py | 155 +++-- pycgmes/resources/ExcIEEEST1A.py | 155 +++-- .../resources/ExcIEEEST1AUELselectorKind.py | 3 +- pycgmes/resources/ExcIEEEST2A.py | 107 ++-- pycgmes/resources/ExcIEEEST3A.py | 163 ++++-- pycgmes/resources/ExcIEEEST4B.py | 131 +++-- pycgmes/resources/ExcIEEEST5B.py | 139 +++-- pycgmes/resources/ExcIEEEST6B.py | 115 ++-- pycgmes/resources/ExcIEEEST7B.py | 123 ++-- pycgmes/resources/ExcNI.py | 83 +-- pycgmes/resources/ExcOEX3T.py | 155 +++-- pycgmes/resources/ExcPIC.py | 187 +++--- pycgmes/resources/ExcREXS.py | 291 ++++++---- .../resources/ExcREXSFeedbackSignalKind.py | 3 +- pycgmes/resources/ExcRQB.py | 107 ++-- pycgmes/resources/ExcSCRX.py | 67 ++- pycgmes/resources/ExcSEXS.py | 83 +-- pycgmes/resources/ExcSK.py | 259 +++++---- pycgmes/resources/ExcST1A.py | 147 +++-- pycgmes/resources/ExcST2A.py | 123 ++-- pycgmes/resources/ExcST3A.py | 163 ++++-- pycgmes/resources/ExcST4B.py | 155 +++-- pycgmes/resources/ExcST6B.py | 187 +++--- pycgmes/resources/ExcST6BOELselectorKind.py | 3 +- pycgmes/resources/ExcST7B.py | 131 +++-- pycgmes/resources/ExcST7BOELselectorKind.py | 3 +- pycgmes/resources/ExcST7BUELselectorKind.py | 3 +- pycgmes/resources/ExcitationSystemDynamics.py | 39 +- .../resources/ExcitationSystemUserDefined.py | 15 +- pycgmes/resources/ExternalNetworkInjection.py | 147 +++-- pycgmes/resources/FaultIndicator.py | 3 +- pycgmes/resources/Float.py | 3 +- pycgmes/resources/FossilFuel.py | 19 +- .../resources/FrancisGovernorControlKind.py | 3 +- pycgmes/resources/Frequency.py | 33 +- pycgmes/resources/FuelType.py | 3 +- pycgmes/resources/Fuse.py | 3 +- pycgmes/resources/GenICompensationForGenJ.py | 35 +- pycgmes/resources/GeneratingUnit.py | 143 +++-- pycgmes/resources/GeneratorControlSource.py | 3 +- .../GenericNonLinearLoadModelKind.py | 3 +- pycgmes/resources/GeographicalRegion.py | 7 +- pycgmes/resources/GovCT1.py | 283 +++++---- pycgmes/resources/GovCT2.py | 451 +++++++++------ pycgmes/resources/GovGAST.py | 83 +-- pycgmes/resources/GovGAST1.py | 275 +++++---- pycgmes/resources/GovGAST2.py | 259 +++++---- pycgmes/resources/GovGAST3.py | 171 +++--- pycgmes/resources/GovGAST4.py | 91 +-- pycgmes/resources/GovGASTWD.py | 267 +++++---- pycgmes/resources/GovHydro1.py | 115 ++-- pycgmes/resources/GovHydro2.py | 235 +++++--- pycgmes/resources/GovHydro3.py | 291 ++++++---- pycgmes/resources/GovHydro4.py | 315 ++++++---- pycgmes/resources/GovHydro4ModelKind.py | 3 +- pycgmes/resources/GovHydroDD.py | 283 +++++---- pycgmes/resources/GovHydroFrancis.py | 219 ++++--- pycgmes/resources/GovHydroIEEE0.py | 67 ++- pycgmes/resources/GovHydroIEEE2.py | 211 ++++--- pycgmes/resources/GovHydroPID.py | 267 +++++---- pycgmes/resources/GovHydroPID2.py | 179 +++--- pycgmes/resources/GovHydroPelton.py | 227 +++++--- pycgmes/resources/GovHydroR.py | 339 ++++++----- pycgmes/resources/GovHydroWEH.py | 411 ++++++++----- pycgmes/resources/GovHydroWPID.py | 179 +++--- pycgmes/resources/GovSteam0.py | 67 ++- pycgmes/resources/GovSteam1.py | 315 ++++++---- pycgmes/resources/GovSteam2.py | 67 ++- pycgmes/resources/GovSteamBB.py | 139 +++-- pycgmes/resources/GovSteamCC.py | 139 +++-- pycgmes/resources/GovSteamEU.py | 283 +++++---- pycgmes/resources/GovSteamFV2.py | 99 ++-- pycgmes/resources/GovSteamFV3.py | 251 +++++--- pycgmes/resources/GovSteamFV4.py | 411 ++++++++----- pycgmes/resources/GovSteamIEEE1.py | 171 +++--- pycgmes/resources/GovSteamSGO.py | 99 ++-- .../resources/GrossToNetActivePowerCurve.py | 11 +- pycgmes/resources/Ground.py | 3 +- pycgmes/resources/GroundDisconnector.py | 3 +- pycgmes/resources/GroundingImpedance.py | 11 +- pycgmes/resources/HVDCDynamics.py | 3 +- .../resources/HydroEnergyConversionKind.py | 3 +- pycgmes/resources/HydroGeneratingUnit.py | 35 +- pycgmes/resources/HydroPlantStorageKind.py | 3 +- pycgmes/resources/HydroPowerPlant.py | 19 +- pycgmes/resources/HydroPump.py | 19 +- pycgmes/resources/HydroTurbineKind.py | 3 +- pycgmes/resources/IOPoint.py | 3 +- pycgmes/resources/IdentifiedObject.py | 97 ++-- pycgmes/resources/IfdBaseKind.py | 3 +- pycgmes/resources/Inductance.py | 27 +- pycgmes/resources/InputSignalKind.py | 3 +- pycgmes/resources/Integer.py | 3 +- pycgmes/resources/Jumper.py | 3 +- pycgmes/resources/Junction.py | 3 +- pycgmes/resources/Length.py | 39 +- pycgmes/resources/Limit.py | 3 +- pycgmes/resources/LimitKind.py | 3 +- pycgmes/resources/LimitSet.py | 11 +- pycgmes/resources/Line.py | 13 +- pycgmes/resources/LinearShuntCompensator.py | 35 +- pycgmes/resources/LoadAggregate.py | 11 +- pycgmes/resources/LoadArea.py | 7 +- pycgmes/resources/LoadBreakSwitch.py | 3 +- pycgmes/resources/LoadComposite.py | 91 +-- pycgmes/resources/LoadDynamics.py | 7 +- pycgmes/resources/LoadGenericNonLinear.py | 59 +- pycgmes/resources/LoadGroup.py | 11 +- pycgmes/resources/LoadMotor.py | 115 ++-- .../resources/LoadResponseCharacteristic.py | 95 +-- pycgmes/resources/LoadStatic.py | 147 +++-- pycgmes/resources/LoadUserDefined.py | 15 +- pycgmes/resources/Location.py | 31 +- pycgmes/resources/Measurement.py | 51 +- pycgmes/resources/MeasurementValue.py | 31 +- pycgmes/resources/MeasurementValueQuality.py | 11 +- pycgmes/resources/MeasurementValueSource.py | 7 +- pycgmes/resources/MechLoad1.py | 35 +- pycgmes/resources/MechanicalLoadDynamics.py | 19 +- .../resources/MechanicalLoadUserDefined.py | 15 +- pycgmes/resources/Money.py | 27 +- pycgmes/resources/MonthDay.py | 3 +- pycgmes/resources/MutualCoupling.py | 83 +-- pycgmes/resources/NonConformLoad.py | 11 +- pycgmes/resources/NonConformLoadGroup.py | 11 +- pycgmes/resources/NonConformLoadSchedule.py | 11 +- .../resources/NonlinearShuntCompensator.py | 7 +- .../NonlinearShuntCompensatorPoint.py | 51 +- pycgmes/resources/NuclearGeneratingUnit.py | 3 +- pycgmes/resources/OperationalLimit.py | 19 +- .../OperationalLimitDirectionKind.py | 3 +- pycgmes/resources/OperationalLimitSet.py | 23 +- pycgmes/resources/OperationalLimitType.py | 39 +- pycgmes/resources/OrientationKind.py | 3 +- pycgmes/resources/OverexcLim2.py | 35 +- pycgmes/resources/OverexcLimIEEE.py | 51 +- pycgmes/resources/OverexcLimX1.py | 83 +-- pycgmes/resources/OverexcLimX2.py | 91 +-- .../OverexcitationLimiterDynamics.py | 11 +- .../OverexcitationLimiterUserDefined.py | 15 +- .../resources/PFVArControllerType1Dynamics.py | 19 +- .../PFVArControllerType1UserDefined.py | 15 +- .../resources/PFVArControllerType2Dynamics.py | 11 +- .../PFVArControllerType2UserDefined.py | 15 +- .../resources/PFVArType1IEEEPFController.py | 67 ++- .../resources/PFVArType1IEEEVArController.py | 51 +- pycgmes/resources/PFVArType2Common1.py | 43 +- .../resources/PFVArType2IEEEPFController.py | 59 +- .../resources/PFVArType2IEEEVArController.py | 59 +- pycgmes/resources/PU.py | 39 +- pycgmes/resources/PerCent.py | 45 +- pycgmes/resources/PetersenCoil.py | 59 +- pycgmes/resources/PetersenCoilModeKind.py | 3 +- pycgmes/resources/PhaseCode.py | 3 +- pycgmes/resources/PhaseTapChanger.py | 11 +- .../resources/PhaseTapChangerAsymmetrical.py | 11 +- pycgmes/resources/PhaseTapChangerLinear.py | 27 +- pycgmes/resources/PhaseTapChangerNonLinear.py | 27 +- .../resources/PhaseTapChangerSymmetrical.py | 3 +- pycgmes/resources/PhaseTapChangerTable.py | 11 +- .../resources/PhaseTapChangerTablePoint.py | 19 +- pycgmes/resources/PhaseTapChangerTabular.py | 11 +- pycgmes/resources/PhotoVoltaicUnit.py | 3 +- pycgmes/resources/PositionPoint.py | 43 +- pycgmes/resources/PostLineSensor.py | 3 +- pycgmes/resources/PotentialTransformer.py | 3 +- .../resources/PowerElectronicsConnection.py | 63 +- pycgmes/resources/PowerElectronicsUnit.py | 23 +- pycgmes/resources/PowerElectronicsWindUnit.py | 3 +- pycgmes/resources/PowerSystemResource.py | 15 +- .../PowerSystemStabilizerDynamics.py | 15 +- .../PowerSystemStabilizerUserDefined.py | 15 +- pycgmes/resources/PowerTransformer.py | 55 +- pycgmes/resources/PowerTransformerEnd.py | 107 ++-- .../resources/ProprietaryParameterDynamics.py | 203 ++++--- pycgmes/resources/ProtectedSwitch.py | 3 +- pycgmes/resources/Pss1.py | 123 ++-- pycgmes/resources/Pss1A.py | 179 +++--- pycgmes/resources/Pss2B.py | 235 +++++--- pycgmes/resources/Pss2ST.py | 147 +++-- pycgmes/resources/Pss5.py | 139 +++-- pycgmes/resources/PssELIN2.py | 91 +-- pycgmes/resources/PssIEEE1A.py | 99 ++-- pycgmes/resources/PssIEEE2B.py | 219 ++++--- pycgmes/resources/PssIEEE3B.py | 139 +++-- pycgmes/resources/PssIEEE4B.py | 539 +++++++++++------- pycgmes/resources/PssPTIST1.py | 91 +-- pycgmes/resources/PssPTIST3.py | 275 +++++---- pycgmes/resources/PssRQB.py | 83 +-- pycgmes/resources/PssSB4.py | 91 +-- pycgmes/resources/PssSH.py | 107 ++-- pycgmes/resources/PssSK.py | 91 +-- pycgmes/resources/PssSTAB2A.py | 67 ++- pycgmes/resources/PssWECC.py | 147 +++-- pycgmes/resources/Quality61850.py | 99 ++-- pycgmes/resources/RaiseLowerCommand.py | 11 +- pycgmes/resources/RatioTapChanger.py | 27 +- pycgmes/resources/RatioTapChangerTable.py | 11 +- .../resources/RatioTapChangerTablePoint.py | 11 +- pycgmes/resources/Reactance.py | 33 +- pycgmes/resources/ReactiveCapabilityCurve.py | 11 +- pycgmes/resources/ReactivePower.py | 39 +- pycgmes/resources/RealEnergy.py | 33 +- pycgmes/resources/RegularIntervalSchedule.py | 23 +- pycgmes/resources/RegularTimePoint.py | 35 +- pycgmes/resources/RegulatingCondEq.py | 19 +- pycgmes/resources/RegulatingControl.py | 83 +-- .../resources/RegulatingControlModeKind.py | 3 +- pycgmes/resources/RegulationSchedule.py | 11 +- pycgmes/resources/RemoteInputSignal.py | 71 ++- pycgmes/resources/RemoteSignalKind.py | 3 +- pycgmes/resources/ReportingGroup.py | 11 +- pycgmes/resources/Resistance.py | 39 +- pycgmes/resources/RotatingMachine.py | 55 +- pycgmes/resources/RotatingMachineDynamics.py | 51 +- pycgmes/resources/RotationSpeed.py | 27 +- pycgmes/resources/RotorKind.py | 3 +- pycgmes/resources/SVCControlMode.py | 3 +- pycgmes/resources/SVCUserDefined.py | 15 +- pycgmes/resources/Season.py | 23 +- pycgmes/resources/SeasonDayTypeSchedule.py | 19 +- pycgmes/resources/Seconds.py | 33 +- pycgmes/resources/Sensor.py | 3 +- pycgmes/resources/SeriesCompensator.py | 59 +- pycgmes/resources/ServiceLocation.py | 3 +- pycgmes/resources/SetPoint.py | 19 +- pycgmes/resources/ShortCircuitRotorKind.py | 3 +- pycgmes/resources/ShuntCompensator.py | 63 +- pycgmes/resources/SolarGeneratingUnit.py | 11 +- pycgmes/resources/SolarPowerPlant.py | 7 +- pycgmes/resources/Source.py | 3 +- pycgmes/resources/StaticLoadModelKind.py | 3 +- pycgmes/resources/StaticVarCompensator.py | 55 +- .../resources/StaticVarCompensatorDynamics.py | 11 +- pycgmes/resources/StationSupply.py | 3 +- pycgmes/resources/Status.py | 35 +- pycgmes/resources/StreetAddress.py | 51 +- pycgmes/resources/StreetDetail.py | 107 ++-- pycgmes/resources/StringMeasurement.py | 7 +- pycgmes/resources/StringMeasurementValue.py | 11 +- pycgmes/resources/SubGeographicalRegion.py | 25 +- pycgmes/resources/SubLoadArea.py | 15 +- pycgmes/resources/Substation.py | 21 +- pycgmes/resources/SurgeArrester.py | 3 +- pycgmes/resources/Susceptance.py | 33 +- pycgmes/resources/SvInjection.py | 27 +- pycgmes/resources/SvPowerFlow.py | 27 +- .../resources/SvShuntCompensatorSections.py | 19 +- pycgmes/resources/SvStatus.py | 19 +- pycgmes/resources/SvSwitch.py | 19 +- pycgmes/resources/SvTapStep.py | 19 +- pycgmes/resources/SvVoltage.py | 27 +- pycgmes/resources/Switch.py | 51 +- pycgmes/resources/SwitchSchedule.py | 11 +- pycgmes/resources/SynchronousMachine.py | 183 +++--- .../resources/SynchronousMachineDetailed.py | 35 +- .../resources/SynchronousMachineDynamics.py | 35 +- .../SynchronousMachineEquivalentCircuit.py | 91 +-- pycgmes/resources/SynchronousMachineKind.py | 3 +- .../resources/SynchronousMachineModelKind.py | 3 +- .../SynchronousMachineOperatingMode.py | 3 +- .../resources/SynchronousMachineSimplified.py | 3 +- ...SynchronousMachineTimeConstantReactance.py | 115 ++-- .../SynchronousMachineUserDefined.py | 15 +- pycgmes/resources/TapChanger.py | 83 +-- pycgmes/resources/TapChangerControl.py | 7 +- pycgmes/resources/TapChangerTablePoint.py | 51 +- pycgmes/resources/TapSchedule.py | 11 +- pycgmes/resources/Temperature.py | 33 +- pycgmes/resources/Terminal.py | 77 +-- pycgmes/resources/TextDiagramObject.py | 11 +- pycgmes/resources/ThermalGeneratingUnit.py | 31 +- pycgmes/resources/TieFlow.py | 27 +- pycgmes/resources/TopologicalIsland.py | 19 +- pycgmes/resources/TopologicalNode.py | 51 +- pycgmes/resources/TownDetail.py | 43 +- pycgmes/resources/TransformerEnd.py | 59 +- pycgmes/resources/TurbLCFB1.py | 99 ++-- pycgmes/resources/TurbineGovernorDynamics.py | 23 +- .../resources/TurbineGovernorUserDefined.py | 15 +- .../TurbineLoadControllerDynamics.py | 11 +- .../TurbineLoadControllerUserDefined.py | 15 +- pycgmes/resources/UnderexcLim2Simplified.py | 59 +- pycgmes/resources/UnderexcLimIEEE1.py | 123 ++-- pycgmes/resources/UnderexcLimIEEE2.py | 323 +++++++---- pycgmes/resources/UnderexcLimX1.py | 51 +- pycgmes/resources/UnderexcLimX2.py | 59 +- .../UnderexcitationLimiterDynamics.py | 15 +- .../UnderexcitationLimiterUserDefined.py | 15 +- pycgmes/resources/UnitMultiplier.py | 3 +- pycgmes/resources/UnitSymbol.py | 3 +- pycgmes/resources/VAdjIEEE.py | 51 +- pycgmes/resources/VCompIEEEType1.py | 27 +- pycgmes/resources/VCompIEEEType2.py | 15 +- pycgmes/resources/VSCDynamics.py | 11 +- pycgmes/resources/VSCUserDefined.py | 15 +- pycgmes/resources/Validity.py | 3 +- pycgmes/resources/ValueAliasSet.py | 19 +- pycgmes/resources/ValueToAlias.py | 19 +- pycgmes/resources/VisibilityLayer.py | 19 +- pycgmes/resources/Voltage.py | 51 +- pycgmes/resources/VoltageAdjusterDynamics.py | 11 +- .../resources/VoltageAdjusterUserDefined.py | 15 +- .../resources/VoltageCompensatorDynamics.py | 15 +- .../VoltageCompensatorUserDefined.py | 15 +- pycgmes/resources/VoltageLevel.py | 47 +- pycgmes/resources/VoltageLimit.py | 19 +- pycgmes/resources/VoltagePerReactivePower.py | 27 +- pycgmes/resources/VolumeFlowRate.py | 27 +- pycgmes/resources/VsCapabilityCurve.py | 7 +- pycgmes/resources/VsConverter.py | 119 ++-- pycgmes/resources/VsPpccControlKind.py | 3 +- pycgmes/resources/VsQpccControlKind.py | 3 +- pycgmes/resources/WaveTrap.py | 3 +- pycgmes/resources/WindAeroConstIEC.py | 7 +- pycgmes/resources/WindAeroOneDimIEC.py | 23 +- pycgmes/resources/WindAeroTwoDimIEC.py | 63 +- pycgmes/resources/WindContCurrLimIEC.py | 67 ++- pycgmes/resources/WindContPType3IEC.py | 195 ++++--- pycgmes/resources/WindContPType4aIEC.py | 31 +- pycgmes/resources/WindContPType4bIEC.py | 39 +- pycgmes/resources/WindContPitchAngleIEC.py | 87 +-- pycgmes/resources/WindContQIEC.py | 191 ++++--- pycgmes/resources/WindContQLimIEC.py | 23 +- pycgmes/resources/WindContQPQULimIEC.py | 27 +- pycgmes/resources/WindContRotorRIEC.py | 75 ++- pycgmes/resources/WindDynamicsLookupTable.py | 107 ++-- pycgmes/resources/WindGenTurbineType1aIEC.py | 11 +- pycgmes/resources/WindGenTurbineType1bIEC.py | 11 +- pycgmes/resources/WindGenTurbineType2IEC.py | 19 +- pycgmes/resources/WindGenType3IEC.py | 31 +- pycgmes/resources/WindGenType3aIEC.py | 23 +- pycgmes/resources/WindGenType3bIEC.py | 31 +- pycgmes/resources/WindGenType4IEC.py | 43 +- pycgmes/resources/WindGenUnitKind.py | 3 +- pycgmes/resources/WindGeneratingUnit.py | 19 +- .../resources/WindLookupTableFunctionKind.py | 3 +- pycgmes/resources/WindMechIEC.py | 47 +- pycgmes/resources/WindPitchContPowerIEC.py | 71 ++- pycgmes/resources/WindPlantDynamics.py | 15 +- pycgmes/resources/WindPlantFreqPcontrolIEC.py | 131 +++-- pycgmes/resources/WindPlantIEC.py | 19 +- .../resources/WindPlantQcontrolModeKind.py | 3 +- .../resources/WindPlantReactiveControlIEC.py | 155 +++-- pycgmes/resources/WindPlantUserDefined.py | 15 +- pycgmes/resources/WindPowerPlant.py | 7 +- pycgmes/resources/WindProtectionIEC.py | 71 ++- pycgmes/resources/WindQcontrolModeKind.py | 3 +- pycgmes/resources/WindRefFrameRotIEC.py | 31 +- .../resources/WindTurbineType1or2Dynamics.py | 19 +- pycgmes/resources/WindTurbineType1or2IEC.py | 19 +- pycgmes/resources/WindTurbineType3IEC.py | 51 +- .../resources/WindTurbineType3or4Dynamics.py | 27 +- pycgmes/resources/WindTurbineType3or4IEC.py | 51 +- pycgmes/resources/WindTurbineType4IEC.py | 11 +- pycgmes/resources/WindTurbineType4aIEC.py | 19 +- pycgmes/resources/WindTurbineType4bIEC.py | 27 +- pycgmes/resources/WindType1or2UserDefined.py | 15 +- pycgmes/resources/WindType3or4UserDefined.py | 15 +- pycgmes/resources/WindUVRTQcontrolModeKind.py | 3 +- pycgmes/resources/WindingConnection.py | 3 +- pycgmes/resources/WorkLocation.py | 3 +- pycgmes/resources/__init__.py | 1 - 525 files changed, 18462 insertions(+), 12051 deletions(-) diff --git a/pycgmes/resources/ACDCConverter.py b/pycgmes/resources/ACDCConverter.py index 39f8e93c..fb770935 100644 --- a/pycgmes/resources/ACDCConverter.py +++ b/pycgmes/resources/ACDCConverter.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class ACDCConverter(ConductingEquipment): """ A unit with valves for three phases, together with unit control equipment, essential protective and switching @@ -65,146 +64,186 @@ class ACDCConverter(ConductingEquipment): baseS: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) idleLoss: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxUdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minUdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) numberOfValves: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedUdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) resistiveLoss: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) switchingLoss: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) valveU0: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) PccTerminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCTerminals : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCTerminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) idc: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) poleLossP: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) udc: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetPpcc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetUdc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ACDCConverterDCTerminal.py b/pycgmes/resources/ACDCConverterDCTerminal.py index e4184af8..cd6d983f 100644 --- a/pycgmes/resources/ACDCConverterDCTerminal.py +++ b/pycgmes/resources/ACDCConverterDCTerminal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCBaseTerminal import DCBaseTerminal -@dataclass(config=DataclassConfig) +@dataclass class ACDCConverterDCTerminal(DCBaseTerminal): """ A DC electrical connection point at the AC/DC converter. The AC/DC converter is electrically connected also to the @@ -35,16 +34,20 @@ class ACDCConverterDCTerminal(DCBaseTerminal): DCConductingEquipment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) polarity: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ACDCTerminal.py b/pycgmes/resources/ACDCTerminal.py index b8c2aaa9..4011baa4 100644 --- a/pycgmes/resources/ACDCTerminal.py +++ b/pycgmes/resources/ACDCTerminal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ACDCTerminal(IdentifiedObject): """ An electrical connection point (AC or DC) to a piece of conducting equipment. Terminals are connected at physical @@ -43,32 +42,38 @@ class ACDCTerminal(IdentifiedObject): sequenceNumber: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # OperationalLimitSet : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # OperationalLimitSet : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 BusNameMarker: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) connected: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Measurements : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Measurements : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ACLineSegment.py b/pycgmes/resources/ACLineSegment.py index 5eff7584..8cabdbed 100644 --- a/pycgmes/resources/ACLineSegment.py +++ b/pycgmes/resources/ACLineSegment.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Conductor import Conductor -@dataclass(config=DataclassConfig) +@dataclass class ACLineSegment(Conductor): """ A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, @@ -44,73 +43,91 @@ class ACLineSegment(Conductor): bch: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) gch: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Clamp : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # Clamp : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Cut : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # Cut : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) b0ch: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) g0ch: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) shortCircuitEndTemperature: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Accumulator.py b/pycgmes/resources/Accumulator.py index a685f042..26550c79 100644 --- a/pycgmes/resources/Accumulator.py +++ b/pycgmes/resources/Accumulator.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Measurement import Measurement -@dataclass(config=DataclassConfig) +@dataclass class Accumulator(Measurement): """ Accumulator represents an accumulated (counted) Measurement, e.g. an energy value. @@ -25,12 +24,12 @@ class Accumulator(Measurement): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # AccumulatorValues : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # AccumulatorValues : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # LimitSets : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # LimitSets : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AccumulatorLimit.py b/pycgmes/resources/AccumulatorLimit.py index a4dfa1ba..45ff9166 100644 --- a/pycgmes/resources/AccumulatorLimit.py +++ b/pycgmes/resources/AccumulatorLimit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Limit import Limit -@dataclass(config=DataclassConfig) +@dataclass class AccumulatorLimit(Limit): """ Limit values for Accumulator measurements. @@ -28,16 +27,20 @@ class AccumulatorLimit(Limit): value: int = Field( default=0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) LimitSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AccumulatorLimitSet.py b/pycgmes/resources/AccumulatorLimitSet.py index cb47d892..d2eeb447 100644 --- a/pycgmes/resources/AccumulatorLimitSet.py +++ b/pycgmes/resources/AccumulatorLimitSet.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LimitSet import LimitSet -@dataclass(config=DataclassConfig) +@dataclass class AccumulatorLimitSet(LimitSet): """ An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement. @@ -27,14 +26,16 @@ class AccumulatorLimitSet(LimitSet): Measurements: list = Field( default_factory=list, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # Limits : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:1..n in CIM + # Limits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AccumulatorReset.py b/pycgmes/resources/AccumulatorReset.py index d6feb91a..967a6b5c 100644 --- a/pycgmes/resources/AccumulatorReset.py +++ b/pycgmes/resources/AccumulatorReset.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Control import Control -@dataclass(config=DataclassConfig) +@dataclass class AccumulatorReset(Control): """ This command resets the counter value to zero. @@ -27,9 +26,11 @@ class AccumulatorReset(Control): AccumulatorValue: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AccumulatorValue.py b/pycgmes/resources/AccumulatorValue.py index f8602b97..ec682714 100644 --- a/pycgmes/resources/AccumulatorValue.py +++ b/pycgmes/resources/AccumulatorValue.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MeasurementValue import MeasurementValue -@dataclass(config=DataclassConfig) +@dataclass class AccumulatorValue(MeasurementValue): """ AccumulatorValue represents an accumulated (counted) MeasurementValue. @@ -28,14 +27,16 @@ class AccumulatorValue(MeasurementValue): Accumulator: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # AccumulatorReset : Optional[str] = Field(default=None, in_profiles = [Profile.OP, ]) + # Type M:0..1 in CIM + # AccumulatorReset : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ActivePower.py b/pycgmes/resources/ActivePower.py index d9a44714..22d5ac45 100644 --- a/pycgmes/resources/ActivePower.py +++ b/pycgmes/resources/ActivePower.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ActivePower(Base): """ Product of RMS value of the voltage and the RMS value of the in-phase component of the current. @@ -29,35 +28,41 @@ class ActivePower(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ActivePowerLimit.py b/pycgmes/resources/ActivePowerLimit.py index 871baf9d..06702ff5 100644 --- a/pycgmes/resources/ActivePowerLimit.py +++ b/pycgmes/resources/ActivePowerLimit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OperationalLimit import OperationalLimit -@dataclass(config=DataclassConfig) +@dataclass class ActivePowerLimit(OperationalLimit): """ Limit on active power flow. @@ -27,16 +26,20 @@ class ActivePowerLimit(OperationalLimit): normalValue: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ActivePowerPerCurrentFlow.py b/pycgmes/resources/ActivePowerPerCurrentFlow.py index a542308d..b3de3fa9 100644 --- a/pycgmes/resources/ActivePowerPerCurrentFlow.py +++ b/pycgmes/resources/ActivePowerPerCurrentFlow.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ActivePowerPerCurrentFlow(Base): """ Active power variation with current flow. @@ -29,23 +28,29 @@ class ActivePowerPerCurrentFlow(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ActivePowerPerFrequency.py b/pycgmes/resources/ActivePowerPerFrequency.py index 35927d94..d9a680db 100644 --- a/pycgmes/resources/ActivePowerPerFrequency.py +++ b/pycgmes/resources/ActivePowerPerFrequency.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ActivePowerPerFrequency(Base): """ Active power variation with frequency. @@ -29,23 +28,29 @@ class ActivePowerPerFrequency(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Analog.py b/pycgmes/resources/Analog.py index 16a9ca07..5be4aa08 100644 --- a/pycgmes/resources/Analog.py +++ b/pycgmes/resources/Analog.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Measurement import Measurement -@dataclass(config=DataclassConfig) +@dataclass class Analog(Measurement): """ Analog represents an analog Measurement. @@ -30,18 +29,20 @@ class Analog(Measurement): positiveFlowIn: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # AnalogValues : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # AnalogValues : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # LimitSets : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # LimitSets : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AnalogControl.py b/pycgmes/resources/AnalogControl.py index e43dbd34..7955ef83 100644 --- a/pycgmes/resources/AnalogControl.py +++ b/pycgmes/resources/AnalogControl.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Control import Control -@dataclass(config=DataclassConfig) +@dataclass class AnalogControl(Control): """ An analog control used for supervisory control. @@ -29,23 +28,29 @@ class AnalogControl(Control): maxValue: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) minValue: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) AnalogValue: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AnalogLimit.py b/pycgmes/resources/AnalogLimit.py index 2bdbe252..27e56da3 100644 --- a/pycgmes/resources/AnalogLimit.py +++ b/pycgmes/resources/AnalogLimit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Limit import Limit -@dataclass(config=DataclassConfig) +@dataclass class AnalogLimit(Limit): """ Limit values for Analog measurements. @@ -28,16 +27,20 @@ class AnalogLimit(Limit): value: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) LimitSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AnalogLimitSet.py b/pycgmes/resources/AnalogLimitSet.py index 4647e88a..4046f97a 100644 --- a/pycgmes/resources/AnalogLimitSet.py +++ b/pycgmes/resources/AnalogLimitSet.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LimitSet import LimitSet -@dataclass(config=DataclassConfig) +@dataclass class AnalogLimitSet(LimitSet): """ An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement. @@ -27,14 +26,16 @@ class AnalogLimitSet(LimitSet): Measurements: list = Field( default_factory=list, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Limits : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Limits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AnalogValue.py b/pycgmes/resources/AnalogValue.py index 9b72c212..18897da9 100644 --- a/pycgmes/resources/AnalogValue.py +++ b/pycgmes/resources/AnalogValue.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MeasurementValue import MeasurementValue -@dataclass(config=DataclassConfig) +@dataclass class AnalogValue(MeasurementValue): """ AnalogValue represents an analog MeasurementValue. @@ -28,14 +27,16 @@ class AnalogValue(MeasurementValue): Analog: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # AnalogControl : Optional[str] = Field(default=None, in_profiles = [Profile.OP, ]) + # Type M:0..1 in CIM + # AnalogControl : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AngleDegrees.py b/pycgmes/resources/AngleDegrees.py index 3dab2625..d5cf99bf 100644 --- a/pycgmes/resources/AngleDegrees.py +++ b/pycgmes/resources/AngleDegrees.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class AngleDegrees(Base): """ Measurement of angle in degrees. @@ -29,38 +28,44 @@ class AngleDegrees(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AngleRadians.py b/pycgmes/resources/AngleRadians.py index 5a768532..608373c4 100644 --- a/pycgmes/resources/AngleRadians.py +++ b/pycgmes/resources/AngleRadians.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class AngleRadians(Base): """ Phase angle in radians. @@ -29,23 +28,29 @@ class AngleRadians(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ApparentPower.py b/pycgmes/resources/ApparentPower.py index ec24adee..70c78867 100644 --- a/pycgmes/resources/ApparentPower.py +++ b/pycgmes/resources/ApparentPower.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ApparentPower(Base): """ Product of the RMS value of the voltage and the RMS value of the current. @@ -29,29 +28,35 @@ class ApparentPower(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ApparentPowerLimit.py b/pycgmes/resources/ApparentPowerLimit.py index c6b6a203..99f92098 100644 --- a/pycgmes/resources/ApparentPowerLimit.py +++ b/pycgmes/resources/ApparentPowerLimit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OperationalLimit import OperationalLimit -@dataclass(config=DataclassConfig) +@dataclass class ApparentPowerLimit(OperationalLimit): """ Apparent power limit. @@ -27,16 +26,20 @@ class ApparentPowerLimit(OperationalLimit): normalValue: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Area.py b/pycgmes/resources/Area.py index 65fbbad3..acbdc88c 100644 --- a/pycgmes/resources/Area.py +++ b/pycgmes/resources/Area.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Area(Base): """ Area. @@ -29,23 +28,29 @@ class Area(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AsynchronousMachine.py b/pycgmes/resources/AsynchronousMachine.py index 2f9f1f35..e43b5ee6 100644 --- a/pycgmes/resources/AsynchronousMachine.py +++ b/pycgmes/resources/AsynchronousMachine.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RotatingMachine import RotatingMachine -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachine(RotatingMachine): """ A rotating machine whose shaft rotates asynchronously with the electrical field. Also known as an induction machine @@ -44,77 +43,97 @@ class AsynchronousMachine(RotatingMachine): nominalFrequency: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) nominalSpeed: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) converterFedDrive: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) efficiency: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) iaIrRatio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) polePairNumber: int = Field( default=0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) ratedMechanicalPower: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) reversible: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) rxLockedRotorRatio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) asynchronousMachineType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # AsynchronousMachineDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # AsynchronousMachineDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AsynchronousMachineDynamics.py b/pycgmes/resources/AsynchronousMachineDynamics.py index a9ef8b27..d63a0431 100644 --- a/pycgmes/resources/AsynchronousMachineDynamics.py +++ b/pycgmes/resources/AsynchronousMachineDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RotatingMachineDynamics import RotatingMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachineDynamics(RotatingMachineDynamics): """ Asynchronous machine whose behaviour is described by reference to a standard model expressed in either time constant @@ -34,22 +33,24 @@ class AsynchronousMachineDynamics(RotatingMachineDynamics): AsynchronousMachine: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # TurbineGovernorDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # TurbineGovernorDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # MechanicalLoadDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # MechanicalLoadDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType1or2Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType1or2Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AsynchronousMachineEquivalentCircuit.py b/pycgmes/resources/AsynchronousMachineEquivalentCircuit.py index dcb70734..44f423f0 100644 --- a/pycgmes/resources/AsynchronousMachineEquivalentCircuit.py +++ b/pycgmes/resources/AsynchronousMachineEquivalentCircuit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AsynchronousMachineDynamics import AsynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachineEquivalentCircuit(AsynchronousMachineDynamics): """ The electrical equations of all variations of the asynchronous model are based on the AsynchronousEquivalentCircuit @@ -40,37 +39,47 @@ class AsynchronousMachineEquivalentCircuit(AsynchronousMachineDynamics): xm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rr1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xlr1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rr2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xlr2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AsynchronousMachineKind.py b/pycgmes/resources/AsynchronousMachineKind.py index cfc7f002..cb9b49e6 100644 --- a/pycgmes/resources/AsynchronousMachineKind.py +++ b/pycgmes/resources/AsynchronousMachineKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachineKind(Base): """ Kind of Asynchronous Machine. diff --git a/pycgmes/resources/AsynchronousMachineTimeConstantReactance.py b/pycgmes/resources/AsynchronousMachineTimeConstantReactance.py index 7127bd90..4f90569b 100644 --- a/pycgmes/resources/AsynchronousMachineTimeConstantReactance.py +++ b/pycgmes/resources/AsynchronousMachineTimeConstantReactance.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AsynchronousMachineDynamics import AsynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachineTimeConstantReactance(AsynchronousMachineDynamics): """ Parameter details: If X'' = X', a single cage (one equivalent rotor winding per axis) is modelled. The "p" in the @@ -37,37 +36,47 @@ class AsynchronousMachineTimeConstantReactance(AsynchronousMachineDynamics): xs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tppo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/AsynchronousMachineUserDefined.py b/pycgmes/resources/AsynchronousMachineUserDefined.py index 717db871..b83ce347 100644 --- a/pycgmes/resources/AsynchronousMachineUserDefined.py +++ b/pycgmes/resources/AsynchronousMachineUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AsynchronousMachineDynamics import AsynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class AsynchronousMachineUserDefined(AsynchronousMachineDynamics): """ Asynchronous machine whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class AsynchronousMachineUserDefined(AsynchronousMachineDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/AuxiliaryEquipment.py b/pycgmes/resources/AuxiliaryEquipment.py index 08d4f40a..3f97a67f 100644 --- a/pycgmes/resources/AuxiliaryEquipment.py +++ b/pycgmes/resources/AuxiliaryEquipment.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class AuxiliaryEquipment(Equipment): """ AuxiliaryEquipment describe equipment that is not performing any primary functions but support for the equipment @@ -29,9 +28,11 @@ class AuxiliaryEquipment(Equipment): Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/BaseVoltage.py b/pycgmes/resources/BaseVoltage.py index 3cf19c3b..d8972357 100644 --- a/pycgmes/resources/BaseVoltage.py +++ b/pycgmes/resources/BaseVoltage.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class BaseVoltage(IdentifiedObject): """ Defines a system base voltage which is referenced. @@ -31,28 +30,30 @@ class BaseVoltage(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TopologicalNode : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # TopologicalNode : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # noqa: E501 nominalVoltage: float = Field( default=0.0, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # VoltageLevel : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # VoltageLevel : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ConductingEquipment : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ConductingEquipment : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TransformerEnds : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # TransformerEnds : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/BasicIntervalSchedule.py b/pycgmes/resources/BasicIntervalSchedule.py index 8e79f9c2..643771e8 100644 --- a/pycgmes/resources/BasicIntervalSchedule.py +++ b/pycgmes/resources/BasicIntervalSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class BasicIntervalSchedule(IdentifiedObject): """ Schedule of values at points in time. @@ -29,23 +28,29 @@ class BasicIntervalSchedule(IdentifiedObject): startTime: str = Field( default="", - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value1Unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value2Unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/BatteryStateKind.py b/pycgmes/resources/BatteryStateKind.py index c227788d..678d136e 100644 --- a/pycgmes/resources/BatteryStateKind.py +++ b/pycgmes/resources/BatteryStateKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class BatteryStateKind(Base): """ The state of the battery unit. diff --git a/pycgmes/resources/BatteryUnit.py b/pycgmes/resources/BatteryUnit.py index 157eaf77..8e12abe5 100644 --- a/pycgmes/resources/BatteryUnit.py +++ b/pycgmes/resources/BatteryUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerElectronicsUnit import PowerElectronicsUnit -@dataclass(config=DataclassConfig) +@dataclass class BatteryUnit(PowerElectronicsUnit): """ An electrochemical energy storage device. @@ -30,23 +29,29 @@ class BatteryUnit(PowerElectronicsUnit): ratedE: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) batteryState: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) storedE: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Bay.py b/pycgmes/resources/Bay.py index ab850669..61f7cc79 100644 --- a/pycgmes/resources/Bay.py +++ b/pycgmes/resources/Bay.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquipmentContainer import EquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class Bay(EquipmentContainer): """ A collection of power system resources (within a given substation) including conducting equipment, protection @@ -29,10 +28,12 @@ class Bay(EquipmentContainer): VoltageLevel: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Boolean.py b/pycgmes/resources/Boolean.py index 9192a06e..e83194d2 100644 --- a/pycgmes/resources/Boolean.py +++ b/pycgmes/resources/Boolean.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Boolean(Base): """ A type with the value space "true" and "false". diff --git a/pycgmes/resources/BoundaryPoint.py b/pycgmes/resources/BoundaryPoint.py index d33c296d..ed72f37c 100644 --- a/pycgmes/resources/BoundaryPoint.py +++ b/pycgmes/resources/BoundaryPoint.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class BoundaryPoint(PowerSystemResource): """ Designates a connection point at which one or more model authority sets shall connect to. The location of the @@ -60,74 +59,92 @@ class BoundaryPoint(PowerSystemResource): fromEndIsoCode: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) fromEndName: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) fromEndNameTso: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) toEndIsoCode: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) toEndName: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) toEndNameTso: str = Field( default="", - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) isDirectCurrent: bool = Field( default=False, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) isExcludedFromAreaInterchange: bool = Field( default=False, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) ConnectivityNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Breaker.py b/pycgmes/resources/Breaker.py index d09b0121..5392783b 100644 --- a/pycgmes/resources/Breaker.py +++ b/pycgmes/resources/Breaker.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ProtectedSwitch import ProtectedSwitch -@dataclass(config=DataclassConfig) +@dataclass class Breaker(ProtectedSwitch): """ A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and diff --git a/pycgmes/resources/BusNameMarker.py b/pycgmes/resources/BusNameMarker.py index 12047d78..e4c1e7d1 100644 --- a/pycgmes/resources/BusNameMarker.py +++ b/pycgmes/resources/BusNameMarker.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class BusNameMarker(IdentifiedObject): """ Used to apply user standard names to TopologicalNodes. Associated with one or more terminals that are normally @@ -34,21 +33,25 @@ class BusNameMarker(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # Terminal : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # Terminal : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) priority: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ReportingGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/BusbarSection.py b/pycgmes/resources/BusbarSection.py index 8202fa5e..b25c7116 100644 --- a/pycgmes/resources/BusbarSection.py +++ b/pycgmes/resources/BusbarSection.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Connector import Connector -@dataclass(config=DataclassConfig) +@dataclass class BusbarSection(Connector): """ A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment @@ -30,9 +29,11 @@ class BusbarSection(Connector): ipMax: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CAESPlant.py b/pycgmes/resources/CAESPlant.py index a30df54e..f4d48233 100644 --- a/pycgmes/resources/CAESPlant.py +++ b/pycgmes/resources/CAESPlant.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class CAESPlant(PowerSystemResource): """ Compressed air energy storage plant. @@ -24,8 +23,8 @@ class CAESPlant(PowerSystemResource): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # ThermalGeneratingUnit : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:0..1 in CIM + # ThermalGeneratingUnit : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/CSCDynamics.py b/pycgmes/resources/CSCDynamics.py index 3f7ada5c..951d1d11 100644 --- a/pycgmes/resources/CSCDynamics.py +++ b/pycgmes/resources/CSCDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .HVDCDynamics import HVDCDynamics -@dataclass(config=DataclassConfig) +@dataclass class CSCDynamics(HVDCDynamics): """ CSC function block whose behaviour is described by reference to a standard model or by definition of a user-defined @@ -28,9 +27,11 @@ class CSCDynamics(HVDCDynamics): CSConverter: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CSCUserDefined.py b/pycgmes/resources/CSCUserDefined.py index cc44534f..98ed9ea2 100644 --- a/pycgmes/resources/CSCUserDefined.py +++ b/pycgmes/resources/CSCUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .CSCDynamics import CSCDynamics -@dataclass(config=DataclassConfig) +@dataclass class CSCUserDefined(CSCDynamics): """ Current source converter (CSC) function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class CSCUserDefined(CSCDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Capacitance.py b/pycgmes/resources/Capacitance.py index d3b003b1..038fce02 100644 --- a/pycgmes/resources/Capacitance.py +++ b/pycgmes/resources/Capacitance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Capacitance(Base): """ Capacitive part of reactance (imaginary part of impedance), at rated frequency. @@ -29,23 +28,29 @@ class Capacitance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Clamp.py b/pycgmes/resources/Clamp.py index 063c6cdf..995ff318 100644 --- a/pycgmes/resources/Clamp.py +++ b/pycgmes/resources/Clamp.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class Clamp(ConductingEquipment): """ A Clamp is a galvanic connection at a line segment where other equipment is connected. A Clamp does not cut the line @@ -31,16 +30,20 @@ class Clamp(ConductingEquipment): ACLineSegment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) lengthFromTerminal1: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CogenerationPlant.py b/pycgmes/resources/CogenerationPlant.py index bc8eb0db..6789a7cd 100644 --- a/pycgmes/resources/CogenerationPlant.py +++ b/pycgmes/resources/CogenerationPlant.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class CogenerationPlant(PowerSystemResource): """ A set of thermal generating units for the production of electrical energy and process steam (usually from the output @@ -26,8 +25,8 @@ class CogenerationPlant(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ThermalGeneratingUnits : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ThermalGeneratingUnits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/CombinedCyclePlant.py b/pycgmes/resources/CombinedCyclePlant.py index de4786bf..1ef40ae8 100644 --- a/pycgmes/resources/CombinedCyclePlant.py +++ b/pycgmes/resources/CombinedCyclePlant.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class CombinedCyclePlant(PowerSystemResource): """ A set of combustion turbines and steam turbines where the exhaust heat from the combustion turbines is recovered to @@ -25,8 +24,8 @@ class CombinedCyclePlant(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ThermalGeneratingUnits : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ThermalGeneratingUnits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Command.py b/pycgmes/resources/Command.py index 7c46ea20..de079bd6 100644 --- a/pycgmes/resources/Command.py +++ b/pycgmes/resources/Command.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Control import Control -@dataclass(config=DataclassConfig) +@dataclass class Command(Control): """ A Command is a discrete control used for supervisory control. @@ -30,30 +29,38 @@ class Command(Control): normalValue: int = Field( default=0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) value: int = Field( default=0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) ValueAliasSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) DiscreteValue: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Conductance.py b/pycgmes/resources/Conductance.py index 0dd7033e..4918402a 100644 --- a/pycgmes/resources/Conductance.py +++ b/pycgmes/resources/Conductance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Conductance(Base): """ Factor by which voltage must be multiplied to give corresponding power lost from a circuit. Real part of admittance. @@ -29,26 +28,32 @@ class Conductance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ConductingEquipment.py b/pycgmes/resources/ConductingEquipment.py index 04f78046..f5352e8f 100644 --- a/pycgmes/resources/ConductingEquipment.py +++ b/pycgmes/resources/ConductingEquipment.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class ConductingEquipment(Equipment): """ The parts of the AC power system that are designed to carry current or that are conductively connected through @@ -31,19 +30,21 @@ class ConductingEquipment(Equipment): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Terminals : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, Profile.DY, ]) # noqa: E501 + # Type M:0..n in CIM + # Terminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, Profile.DY, ]}) # noqa: E501 BaseVoltage: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvStatus : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvStatus : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Conductor.py b/pycgmes/resources/Conductor.py index 878fd04e..df8349cd 100644 --- a/pycgmes/resources/Conductor.py +++ b/pycgmes/resources/Conductor.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class Conductor(ConductingEquipment): """ Combination of conducting material with consistent electrical characteristics, building a single electrical system, @@ -27,9 +26,11 @@ class Conductor(ConductingEquipment): length: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ConformLoad.py b/pycgmes/resources/ConformLoad.py index ccb477b7..4a68e4ee 100644 --- a/pycgmes/resources/ConformLoad.py +++ b/pycgmes/resources/ConformLoad.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConsumer import EnergyConsumer -@dataclass(config=DataclassConfig) +@dataclass class ConformLoad(EnergyConsumer): """ ConformLoad represent loads that follow a daily load change pattern where the pattern can be used to scale the load @@ -28,9 +27,11 @@ class ConformLoad(EnergyConsumer): LoadGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ConformLoadGroup.py b/pycgmes/resources/ConformLoadGroup.py index 22a4af61..6cf89e13 100644 --- a/pycgmes/resources/ConformLoadGroup.py +++ b/pycgmes/resources/ConformLoadGroup.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadGroup import LoadGroup -@dataclass(config=DataclassConfig) +@dataclass class ConformLoadGroup(LoadGroup): """ A group of loads conforming to an allocation pattern. @@ -25,12 +24,12 @@ class ConformLoadGroup(LoadGroup): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ConformLoadSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ConformLoadSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # EnergyConsumers : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # EnergyConsumers : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ConformLoadSchedule.py b/pycgmes/resources/ConformLoadSchedule.py index b351ac3d..1a6fa50d 100644 --- a/pycgmes/resources/ConformLoadSchedule.py +++ b/pycgmes/resources/ConformLoadSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SeasonDayTypeSchedule import SeasonDayTypeSchedule -@dataclass(config=DataclassConfig) +@dataclass class ConformLoadSchedule(SeasonDayTypeSchedule): """ A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for @@ -29,9 +28,11 @@ class ConformLoadSchedule(SeasonDayTypeSchedule): ConformLoadGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ConnectivityNode.py b/pycgmes/resources/ConnectivityNode.py index f94ba95a..fe7fb2e8 100644 --- a/pycgmes/resources/ConnectivityNode.py +++ b/pycgmes/resources/ConnectivityNode.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ConnectivityNode(IdentifiedObject): """ Connectivity nodes are points where terminals of AC conducting equipment are connected together with zero impedance. @@ -31,25 +30,29 @@ class ConnectivityNode(IdentifiedObject): TopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # BoundaryPoint : Optional[str] = Field(default=None, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..1 in CIM + # BoundaryPoint : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Terminals : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Terminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 ConnectivityNodeContainer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ConnectivityNodeContainer.py b/pycgmes/resources/ConnectivityNodeContainer.py index 7cd830a5..cf438fbf 100644 --- a/pycgmes/resources/ConnectivityNodeContainer.py +++ b/pycgmes/resources/ConnectivityNodeContainer.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class ConnectivityNodeContainer(PowerSystemResource): """ A base class for all objects that may contain connectivity nodes or topological nodes. @@ -25,12 +24,12 @@ class ConnectivityNodeContainer(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TopologicalNode : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # TopologicalNode : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ConnectivityNodes : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # ConnectivityNodes : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Connector.py b/pycgmes/resources/Connector.py index a8dd5a52..6a9bc554 100644 --- a/pycgmes/resources/Connector.py +++ b/pycgmes/resources/Connector.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class Connector(ConductingEquipment): """ A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment diff --git a/pycgmes/resources/Control.py b/pycgmes/resources/Control.py index 03e00401..1690ecd9 100644 --- a/pycgmes/resources/Control.py +++ b/pycgmes/resources/Control.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IOPoint import IOPoint -@dataclass(config=DataclassConfig) +@dataclass class Control(IOPoint): """ Control is used for supervisory/device control. It represents control outputs that are used to change the state in a @@ -34,44 +33,56 @@ class Control(IOPoint): controlType: str = Field( default="", - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) operationInProgress: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) timeStamp: str = Field( default="", - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) unitMultiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) unitSymbol: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) PowerSystemResource: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ControlArea.py b/pycgmes/resources/ControlArea.py index 6714d779..bc9f4960 100644 --- a/pycgmes/resources/ControlArea.py +++ b/pycgmes/resources/ControlArea.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class ControlArea(PowerSystemResource): """ A control area is a grouping of generating units and/or loads and a cutset of tie lines (as terminals) which may be @@ -51,38 +50,46 @@ class ControlArea(PowerSystemResource): type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TieFlow : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # TieFlow : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ControlAreaGeneratingUnit : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ControlAreaGeneratingUnit : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 EnergyArea: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) netInterchange: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) pTolerance: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ControlAreaGeneratingUnit.py b/pycgmes/resources/ControlAreaGeneratingUnit.py index 5ed1cabf..0fd804fb 100644 --- a/pycgmes/resources/ControlAreaGeneratingUnit.py +++ b/pycgmes/resources/ControlAreaGeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ControlAreaGeneratingUnit(IdentifiedObject): """ A control area generating unit. This class is needed so that alternate control area definitions may include the same @@ -31,16 +30,20 @@ class ControlAreaGeneratingUnit(IdentifiedObject): ControlArea: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) GeneratingUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ControlAreaTypeKind.py b/pycgmes/resources/ControlAreaTypeKind.py index c1795411..29a17f46 100644 --- a/pycgmes/resources/ControlAreaTypeKind.py +++ b/pycgmes/resources/ControlAreaTypeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ControlAreaTypeKind(Base): """ The type of control area. diff --git a/pycgmes/resources/CoordinateSystem.py b/pycgmes/resources/CoordinateSystem.py index 7d67526d..278db89f 100644 --- a/pycgmes/resources/CoordinateSystem.py +++ b/pycgmes/resources/CoordinateSystem.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class CoordinateSystem(IdentifiedObject): """ Coordinate reference system. @@ -33,14 +32,16 @@ class CoordinateSystem(IdentifiedObject): crsUrn: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Locations : list = Field(default_factory=list, in_profiles = [Profile.GL, ]) + # Type M:0..n in CIM + # Locations : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.GL, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/CrossCompoundTurbineGovernorDynamics.py b/pycgmes/resources/CrossCompoundTurbineGovernorDynamics.py index 889848f0..3d9408e7 100644 --- a/pycgmes/resources/CrossCompoundTurbineGovernorDynamics.py +++ b/pycgmes/resources/CrossCompoundTurbineGovernorDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class CrossCompoundTurbineGovernorDynamics(DynamicsFunctionBlock): """ Turbine-governor cross-compound function block whose behaviour is described by reference to a standard model or by @@ -31,16 +30,20 @@ class CrossCompoundTurbineGovernorDynamics(DynamicsFunctionBlock): HighPressureSynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) LowPressureSynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CsConverter.py b/pycgmes/resources/CsConverter.py index 9b18663d..4a92d07b 100644 --- a/pycgmes/resources/CsConverter.py +++ b/pycgmes/resources/CsConverter.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ACDCConverter import ACDCConverter -@dataclass(config=DataclassConfig) +@dataclass class CsConverter(ACDCConverter): """ DC side of the current source converter (CSC). The firing angle controls the dc voltage at the converter, both for @@ -72,105 +71,133 @@ class CsConverter(ACDCConverter): maxAlpha: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxGamma: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxIdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minAlpha: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minGamma: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minIdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedIdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) alpha: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) gamma: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) operatingMode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) pPccControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetAlpha: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetGamma: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetIdc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # CSCDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # CSCDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/CsOperatingModeKind.py b/pycgmes/resources/CsOperatingModeKind.py index 2b91d5e1..4eb94d71 100644 --- a/pycgmes/resources/CsOperatingModeKind.py +++ b/pycgmes/resources/CsOperatingModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class CsOperatingModeKind(Base): """ Operating mode for HVDC line operating as Current Source Converter. diff --git a/pycgmes/resources/CsPpccControlKind.py b/pycgmes/resources/CsPpccControlKind.py index a0812551..35e59064 100644 --- a/pycgmes/resources/CsPpccControlKind.py +++ b/pycgmes/resources/CsPpccControlKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class CsPpccControlKind(Base): """ Active power control modes for HVDC line operating as Current Source Converter. diff --git a/pycgmes/resources/Currency.py b/pycgmes/resources/Currency.py index e828e4f4..97a9f888 100644 --- a/pycgmes/resources/Currency.py +++ b/pycgmes/resources/Currency.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Currency(Base): """ Monetary currencies. ISO 4217 standard including 3-character currency code. diff --git a/pycgmes/resources/CurrentFlow.py b/pycgmes/resources/CurrentFlow.py index ee49f743..92922d46 100644 --- a/pycgmes/resources/CurrentFlow.py +++ b/pycgmes/resources/CurrentFlow.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class CurrentFlow(Base): """ Electrical current with sign convention: positive flow is out of the conducting equipment into the connectivity @@ -30,32 +29,38 @@ class CurrentFlow(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CurrentLimit.py b/pycgmes/resources/CurrentLimit.py index 5fb2fdb3..28bdce01 100644 --- a/pycgmes/resources/CurrentLimit.py +++ b/pycgmes/resources/CurrentLimit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OperationalLimit import OperationalLimit -@dataclass(config=DataclassConfig) +@dataclass class CurrentLimit(OperationalLimit): """ Operational limit on current. @@ -27,16 +26,20 @@ class CurrentLimit(OperationalLimit): normalValue: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CurrentTransformer.py b/pycgmes/resources/CurrentTransformer.py index 118cc083..6de9e32e 100644 --- a/pycgmes/resources/CurrentTransformer.py +++ b/pycgmes/resources/CurrentTransformer.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Sensor import Sensor -@dataclass(config=DataclassConfig) +@dataclass class CurrentTransformer(Sensor): """ Instrument transformer used to measure electrical qualities of the circuit that is being protected and/or monitored. diff --git a/pycgmes/resources/Curve.py b/pycgmes/resources/Curve.py index ef8c63b0..0e026304 100644 --- a/pycgmes/resources/Curve.py +++ b/pycgmes/resources/Curve.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Curve(IdentifiedObject): """ A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) @@ -32,35 +31,43 @@ class Curve(IdentifiedObject): curveStyle: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) y1Unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) y2Unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # CurveDatas : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # CurveDatas : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/CurveData.py b/pycgmes/resources/CurveData.py index 1f14af1a..c7406491 100644 --- a/pycgmes/resources/CurveData.py +++ b/pycgmes/resources/CurveData.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class CurveData(Base): """ Multi-purpose data points for defining a curve. The use of this generic class is discouraged if a more specific @@ -31,30 +30,38 @@ class can be used to specify the X and Y axis values along with their specific d Curve: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xvalue: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) y1value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) y2value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/CurveStyle.py b/pycgmes/resources/CurveStyle.py index 225e7933..0b5389b3 100644 --- a/pycgmes/resources/CurveStyle.py +++ b/pycgmes/resources/CurveStyle.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class CurveStyle(Base): """ Style or shape of curve. diff --git a/pycgmes/resources/Cut.py b/pycgmes/resources/Cut.py index a70c3fe5..d37e8904 100644 --- a/pycgmes/resources/Cut.py +++ b/pycgmes/resources/Cut.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class Cut(Switch): """ A cut separates a line segment into two parts. The cut appears as a switch inserted between these two parts and @@ -36,16 +35,20 @@ class Cut(Switch): ACLineSegment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) lengthFromTerminal1: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCBaseTerminal.py b/pycgmes/resources/DCBaseTerminal.py index 31efc358..c6322a5e 100644 --- a/pycgmes/resources/DCBaseTerminal.py +++ b/pycgmes/resources/DCBaseTerminal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ACDCTerminal import ACDCTerminal -@dataclass(config=DataclassConfig) +@dataclass class DCBaseTerminal(ACDCTerminal): """ An electrical connection point at a piece of DC conducting equipment. DC terminals are connected at one physical DC @@ -30,16 +29,20 @@ class DCBaseTerminal(ACDCTerminal): DCTopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) DCNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCBreaker.py b/pycgmes/resources/DCBreaker.py index b16610df..fec695dd 100644 --- a/pycgmes/resources/DCBreaker.py +++ b/pycgmes/resources/DCBreaker.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCSwitch import DCSwitch -@dataclass(config=DataclassConfig) +@dataclass class DCBreaker(DCSwitch): """ A breaker within a DC system. diff --git a/pycgmes/resources/DCBusbar.py b/pycgmes/resources/DCBusbar.py index 5b4f9381..16922e41 100644 --- a/pycgmes/resources/DCBusbar.py +++ b/pycgmes/resources/DCBusbar.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCBusbar(DCConductingEquipment): """ A busbar within a DC system. diff --git a/pycgmes/resources/DCChopper.py b/pycgmes/resources/DCChopper.py index f130fc9b..03b2609e 100644 --- a/pycgmes/resources/DCChopper.py +++ b/pycgmes/resources/DCChopper.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCChopper(DCConductingEquipment): """ Low resistance equipment used in the internal DC circuit to balance voltages. It has typically positive and negative diff --git a/pycgmes/resources/DCConductingEquipment.py b/pycgmes/resources/DCConductingEquipment.py index 1fcbafb2..c42ef239 100644 --- a/pycgmes/resources/DCConductingEquipment.py +++ b/pycgmes/resources/DCConductingEquipment.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class DCConductingEquipment(Equipment): """ The parts of the DC power system that are designed to carry current or that are conductively connected through DC @@ -29,14 +28,16 @@ class DCConductingEquipment(Equipment): ratedUdc: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCTerminals : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCTerminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/DCConverterOperatingModeKind.py b/pycgmes/resources/DCConverterOperatingModeKind.py index 89581c66..3e862c93 100644 --- a/pycgmes/resources/DCConverterOperatingModeKind.py +++ b/pycgmes/resources/DCConverterOperatingModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DCConverterOperatingModeKind(Base): """ The operating mode of an HVDC bipole. diff --git a/pycgmes/resources/DCConverterUnit.py b/pycgmes/resources/DCConverterUnit.py index 72819632..2263b426 100644 --- a/pycgmes/resources/DCConverterUnit.py +++ b/pycgmes/resources/DCConverterUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCEquipmentContainer import DCEquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class DCConverterUnit(DCEquipmentContainer): """ Indivisible operative unit comprising all equipment between the point of common coupling on the AC side and the @@ -31,16 +30,20 @@ class DCConverterUnit(DCEquipmentContainer): operationMode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) Substation: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCDisconnector.py b/pycgmes/resources/DCDisconnector.py index a3482cf0..af6bc8ce 100644 --- a/pycgmes/resources/DCDisconnector.py +++ b/pycgmes/resources/DCDisconnector.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCSwitch import DCSwitch -@dataclass(config=DataclassConfig) +@dataclass class DCDisconnector(DCSwitch): """ A disconnector within a DC system. diff --git a/pycgmes/resources/DCEquipmentContainer.py b/pycgmes/resources/DCEquipmentContainer.py index 73785ca6..e4417494 100644 --- a/pycgmes/resources/DCEquipmentContainer.py +++ b/pycgmes/resources/DCEquipmentContainer.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquipmentContainer import EquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class DCEquipmentContainer(EquipmentContainer): """ A modelling construct to provide a root class for containment of DC as well as AC equipment. The class differ from @@ -27,12 +26,12 @@ class DCEquipmentContainer(EquipmentContainer): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCTopologicalNode : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # DCTopologicalNode : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCNodes : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCNodes : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/DCGround.py b/pycgmes/resources/DCGround.py index e5e567b1..5a60e74e 100644 --- a/pycgmes/resources/DCGround.py +++ b/pycgmes/resources/DCGround.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCGround(DCConductingEquipment): """ A ground within a DC system. @@ -27,16 +26,20 @@ class DCGround(DCConductingEquipment): inductance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCLine.py b/pycgmes/resources/DCLine.py index 57edfad7..24136fd9 100644 --- a/pycgmes/resources/DCLine.py +++ b/pycgmes/resources/DCLine.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCEquipmentContainer import DCEquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class DCLine(DCEquipmentContainer): """ Overhead lines and/or cables connecting two or more HVDC substations. @@ -27,9 +26,11 @@ class DCLine(DCEquipmentContainer): Region: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCLineSegment.py b/pycgmes/resources/DCLineSegment.py index bb3a376f..b3a3a538 100644 --- a/pycgmes/resources/DCLineSegment.py +++ b/pycgmes/resources/DCLineSegment.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCLineSegment(DCConductingEquipment): """ A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to @@ -30,30 +29,38 @@ class DCLineSegment(DCConductingEquipment): capacitance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) inductance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) resistance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) length: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCNode.py b/pycgmes/resources/DCNode.py index d4a20b41..06593f7e 100644 --- a/pycgmes/resources/DCNode.py +++ b/pycgmes/resources/DCNode.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DCNode(IdentifiedObject): """ DC nodes are points where terminals of DC conducting equipment are connected together with zero impedance. @@ -30,20 +29,24 @@ class DCNode(IdentifiedObject): DCTopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCTerminals : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCTerminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) DCEquipmentContainer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCPolarityKind.py b/pycgmes/resources/DCPolarityKind.py index b7045b59..7519d34c 100644 --- a/pycgmes/resources/DCPolarityKind.py +++ b/pycgmes/resources/DCPolarityKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DCPolarityKind(Base): """ Polarity for DC circuits. diff --git a/pycgmes/resources/DCSeriesDevice.py b/pycgmes/resources/DCSeriesDevice.py index e2e98546..2a2b24a5 100644 --- a/pycgmes/resources/DCSeriesDevice.py +++ b/pycgmes/resources/DCSeriesDevice.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCSeriesDevice(DCConductingEquipment): """ A series device within the DC system, typically a reactor used for filtering or smoothing. Needed for transient and @@ -28,16 +27,20 @@ class DCSeriesDevice(DCConductingEquipment): inductance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) resistance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCShunt.py b/pycgmes/resources/DCShunt.py index 39b49bc8..7a621f75 100644 --- a/pycgmes/resources/DCShunt.py +++ b/pycgmes/resources/DCShunt.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCShunt(DCConductingEquipment): """ A shunt device within the DC system, typically used for filtering. Needed for transient and short circuit studies. @@ -27,16 +26,20 @@ class DCShunt(DCConductingEquipment): capacitance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) resistance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCSwitch.py b/pycgmes/resources/DCSwitch.py index 4db3cf6c..c250529d 100644 --- a/pycgmes/resources/DCSwitch.py +++ b/pycgmes/resources/DCSwitch.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCConductingEquipment import DCConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class DCSwitch(DCConductingEquipment): """ A switch within the DC system. diff --git a/pycgmes/resources/DCTerminal.py b/pycgmes/resources/DCTerminal.py index d3e91523..ba1149d9 100644 --- a/pycgmes/resources/DCTerminal.py +++ b/pycgmes/resources/DCTerminal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DCBaseTerminal import DCBaseTerminal -@dataclass(config=DataclassConfig) +@dataclass class DCTerminal(DCBaseTerminal): """ An electrical connection point to generic DC conducting equipment. @@ -27,9 +26,11 @@ class DCTerminal(DCBaseTerminal): DCConductingEquipment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCTopologicalIsland.py b/pycgmes/resources/DCTopologicalIsland.py index a6638746..b3a965e4 100644 --- a/pycgmes/resources/DCTopologicalIsland.py +++ b/pycgmes/resources/DCTopologicalIsland.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DCTopologicalIsland(IdentifiedObject): """ An electrically connected subset of the network. DC topological islands can change as the current network state @@ -29,9 +28,11 @@ class DCTopologicalIsland(IdentifiedObject): DCTopologicalNodes: list = Field( default_factory=list, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DCTopologicalNode.py b/pycgmes/resources/DCTopologicalNode.py index 4dfe519e..ff905b08 100644 --- a/pycgmes/resources/DCTopologicalNode.py +++ b/pycgmes/resources/DCTopologicalNode.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DCTopologicalNode(IdentifiedObject): """ DC bus. @@ -30,23 +29,25 @@ class DCTopologicalNode(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCTerminals : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # DCTerminals : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) DCEquipmentContainer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCNodes : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # DCNodes : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # DCTopologicalIsland : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # DCTopologicalIsland : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Date.py b/pycgmes/resources/Date.py index 4f581ca9..e9f22bcf 100644 --- a/pycgmes/resources/Date.py +++ b/pycgmes/resources/Date.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Date(Base): """ Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone diff --git a/pycgmes/resources/DateTime.py b/pycgmes/resources/DateTime.py index 7d49cee0..d3a57b3b 100644 --- a/pycgmes/resources/DateTime.py +++ b/pycgmes/resources/DateTime.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DateTime(Base): """ Date and time as "yyyy-mm-ddThh:mm:ss.sss", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm- diff --git a/pycgmes/resources/DayType.py b/pycgmes/resources/DayType.py index 221542aa..3cf5402f 100644 --- a/pycgmes/resources/DayType.py +++ b/pycgmes/resources/DayType.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DayType(IdentifiedObject): """ Group of similar days. For example it could be used to represent weekdays, weekend, or holidays. @@ -24,8 +23,8 @@ class DayType(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # SeasonDayTypeSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # SeasonDayTypeSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Decimal.py b/pycgmes/resources/Decimal.py index 1bf6bbfe..8890d201 100644 --- a/pycgmes/resources/Decimal.py +++ b/pycgmes/resources/Decimal.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Decimal(Base): """ Decimal is the base-10 notational system for representing real numbers. diff --git a/pycgmes/resources/Diagram.py b/pycgmes/resources/Diagram.py index a74306f9..694a9d70 100644 --- a/pycgmes/resources/Diagram.py +++ b/pycgmes/resources/Diagram.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Diagram(IdentifiedObject): """ The diagram being exchanged. The coordinate system is a standard Cartesian coordinate system and the orientation @@ -40,48 +39,60 @@ class Diagram(IdentifiedObject): orientation: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) x1InitialView: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) x2InitialView: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) y1InitialView: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) y2InitialView: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DiagramElements : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # DiagramElements : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) # noqa: E501 DiagramStyle: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiagramObject.py b/pycgmes/resources/DiagramObject.py index f99aaa5b..a4afd6a8 100644 --- a/pycgmes/resources/DiagramObject.py +++ b/pycgmes/resources/DiagramObject.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DiagramObject(IdentifiedObject): """ An object that defines one or more points in a given space. This object can be associated with anything that @@ -57,66 +56,82 @@ class DiagramObject(IdentifiedObject): Diagram: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) drawingOrder: int = Field( default=0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) isPolygon: bool = Field( default=False, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) offsetX: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) offsetY: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) rotation: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) IdentifiedObject: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DiagramObjectPoints : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # DiagramObjectPoints : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # VisibilityLayers : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # VisibilityLayers : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) # noqa: E501 DiagramObjectStyle: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiagramObjectGluePoint.py b/pycgmes/resources/DiagramObjectGluePoint.py index 8bfbf86b..aba78283 100644 --- a/pycgmes/resources/DiagramObjectGluePoint.py +++ b/pycgmes/resources/DiagramObjectGluePoint.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DiagramObjectGluePoint(Base): """ This is used for grouping diagram object points from different diagram objects that are considered to be glued @@ -26,8 +25,8 @@ class DiagramObjectGluePoint(Base): """ # *Association not used* - # Type M:2..n in CIM # pylint: disable-next=line-too-long - # DiagramObjectPoints : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:2..n in CIM + # DiagramObjectPoints : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/DiagramObjectPoint.py b/pycgmes/resources/DiagramObjectPoint.py index 97db434b..a993103f 100644 --- a/pycgmes/resources/DiagramObjectPoint.py +++ b/pycgmes/resources/DiagramObjectPoint.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DiagramObjectPoint(Base): """ A point in a given space defined by 3 coordinates and associated to a diagram object. The coordinates may be @@ -34,44 +33,56 @@ class DiagramObjectPoint(Base): DiagramObject: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) DiagramObjectGluePoint: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) sequenceNumber: int = Field( default=0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) xPosition: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) yPosition: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) zPosition: float = Field( default=0.0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiagramObjectStyle.py b/pycgmes/resources/DiagramObjectStyle.py index f483b3d2..ab78dc82 100644 --- a/pycgmes/resources/DiagramObjectStyle.py +++ b/pycgmes/resources/DiagramObjectStyle.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DiagramObjectStyle(IdentifiedObject): """ A reference to a style used by the originating system for a diagram object. A diagram object style describes @@ -25,8 +24,8 @@ class DiagramObjectStyle(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # StyledObjects : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # StyledObjects : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/DiagramStyle.py b/pycgmes/resources/DiagramStyle.py index 4e3aae01..84511143 100644 --- a/pycgmes/resources/DiagramStyle.py +++ b/pycgmes/resources/DiagramStyle.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DiagramStyle(IdentifiedObject): """ The diagram style refers to a style used by the originating system for a diagram. A diagram style describes @@ -25,8 +24,8 @@ class DiagramStyle(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Diagram : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # Diagram : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/DiscExcContIEEEDEC1A.py b/pycgmes/resources/DiscExcContIEEEDEC1A.py index 616d8ece..9a088266 100644 --- a/pycgmes/resources/DiscExcContIEEEDEC1A.py +++ b/pycgmes/resources/DiscExcContIEEEDEC1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DiscontinuousExcitationControlDynamics import DiscontinuousExcitationControlDynamics -@dataclass(config=DataclassConfig) +@dataclass class DiscExcContIEEEDEC1A(DiscontinuousExcitationControlDynamics): """ IEEE type DEC1A discontinuous excitation control model that boosts generator excitation to a level higher than that @@ -45,128 +44,164 @@ class DiscExcContIEEEDEC1A(DiscontinuousExcitationControlDynamics): vtlmt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vomax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vomin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ketl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) val: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) esc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kan: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tan: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vanmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiscExcContIEEEDEC2A.py b/pycgmes/resources/DiscExcContIEEEDEC2A.py index b22f77fd..4aa503ee 100644 --- a/pycgmes/resources/DiscExcContIEEEDEC2A.py +++ b/pycgmes/resources/DiscExcContIEEEDEC2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DiscontinuousExcitationControlDynamics import DiscontinuousExcitationControlDynamics -@dataclass(config=DataclassConfig) +@dataclass class DiscExcContIEEEDEC2A(DiscontinuousExcitationControlDynamics): """ IEEE type DEC2A model for discontinuous excitation control. This system provides transient excitation boosting via @@ -31,37 +30,47 @@ class DiscExcContIEEEDEC2A(DiscontinuousExcitationControlDynamics): vk: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiscExcContIEEEDEC3A.py b/pycgmes/resources/DiscExcContIEEEDEC3A.py index a8909f03..2f9dfc78 100644 --- a/pycgmes/resources/DiscExcContIEEEDEC3A.py +++ b/pycgmes/resources/DiscExcContIEEEDEC3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DiscontinuousExcitationControlDynamics import DiscontinuousExcitationControlDynamics -@dataclass(config=DataclassConfig) +@dataclass class DiscExcContIEEEDEC3A(DiscontinuousExcitationControlDynamics): """ IEEE type DEC3A model. In some systems, the stabilizer output is disconnected from the regulator immediately @@ -29,16 +28,20 @@ class DiscExcContIEEEDEC3A(DiscontinuousExcitationControlDynamics): vtmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DisconnectingCircuitBreaker.py b/pycgmes/resources/DisconnectingCircuitBreaker.py index 884e018e..12782eef 100644 --- a/pycgmes/resources/DisconnectingCircuitBreaker.py +++ b/pycgmes/resources/DisconnectingCircuitBreaker.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Breaker import Breaker -@dataclass(config=DataclassConfig) +@dataclass class DisconnectingCircuitBreaker(Breaker): """ A circuit breaking device including disconnecting function, eliminating the need for separate disconnectors. diff --git a/pycgmes/resources/Disconnector.py b/pycgmes/resources/Disconnector.py index a99a9c1e..5313ae65 100644 --- a/pycgmes/resources/Disconnector.py +++ b/pycgmes/resources/Disconnector.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class Disconnector(Switch): """ A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or diff --git a/pycgmes/resources/DiscontinuousExcitationControlDynamics.py b/pycgmes/resources/DiscontinuousExcitationControlDynamics.py index 28b71449..34234c92 100644 --- a/pycgmes/resources/DiscontinuousExcitationControlDynamics.py +++ b/pycgmes/resources/DiscontinuousExcitationControlDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class DiscontinuousExcitationControlDynamics(DynamicsFunctionBlock): """ Discontinuous excitation control function block whose behaviour is described by reference to a standard model or by @@ -29,14 +28,16 @@ class DiscontinuousExcitationControlDynamics(DynamicsFunctionBlock): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # RemoteInputSignal : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiscontinuousExcitationControlUserDefined.py b/pycgmes/resources/DiscontinuousExcitationControlUserDefined.py index ea91c23c..eb9ed2a7 100644 --- a/pycgmes/resources/DiscontinuousExcitationControlUserDefined.py +++ b/pycgmes/resources/DiscontinuousExcitationControlUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DiscontinuousExcitationControlDynamics import DiscontinuousExcitationControlDynamics -@dataclass(config=DataclassConfig) +@dataclass class DiscontinuousExcitationControlUserDefined(DiscontinuousExcitationControlDynamics): """ Discontinuous excitation control function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class DiscontinuousExcitationControlUserDefined(DiscontinuousExcitationControlDy proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Discrete.py b/pycgmes/resources/Discrete.py index 2b35aca5..e4a93f3b 100644 --- a/pycgmes/resources/Discrete.py +++ b/pycgmes/resources/Discrete.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Measurement import Measurement -@dataclass(config=DataclassConfig) +@dataclass class Discrete(Measurement): """ Discrete represents a discrete Measurement, i.e. a Measurement representing discrete values, e.g. a Breaker @@ -28,14 +27,16 @@ class Discrete(Measurement): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DiscreteValues : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # DiscreteValues : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) ValueAliasSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DiscreteValue.py b/pycgmes/resources/DiscreteValue.py index 970c1ad6..0dc4e32f 100644 --- a/pycgmes/resources/DiscreteValue.py +++ b/pycgmes/resources/DiscreteValue.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MeasurementValue import MeasurementValue -@dataclass(config=DataclassConfig) +@dataclass class DiscreteValue(MeasurementValue): """ DiscreteValue represents a discrete MeasurementValue. @@ -27,14 +26,16 @@ class DiscreteValue(MeasurementValue): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # Command : Optional[str] = Field(default=None, in_profiles = [Profile.OP, ]) + # Type M:0..1 in CIM + # Command : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.OP, ]}) Discrete: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/DroopSignalFeedbackKind.py b/pycgmes/resources/DroopSignalFeedbackKind.py index de713172..28d85f26 100644 --- a/pycgmes/resources/DroopSignalFeedbackKind.py +++ b/pycgmes/resources/DroopSignalFeedbackKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class DroopSignalFeedbackKind(Base): """ Governor droop signal feedback source. diff --git a/pycgmes/resources/DynamicsFunctionBlock.py b/pycgmes/resources/DynamicsFunctionBlock.py index 994ceeaa..8289debb 100644 --- a/pycgmes/resources/DynamicsFunctionBlock.py +++ b/pycgmes/resources/DynamicsFunctionBlock.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class DynamicsFunctionBlock(IdentifiedObject): """ Abstract parent class for all Dynamics function blocks. @@ -27,9 +26,11 @@ class DynamicsFunctionBlock(IdentifiedObject): enabled: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EarthFaultCompensator.py b/pycgmes/resources/EarthFaultCompensator.py index 89bab602..b859b9fb 100644 --- a/pycgmes/resources/EarthFaultCompensator.py +++ b/pycgmes/resources/EarthFaultCompensator.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class EarthFaultCompensator(ConductingEquipment): """ A conducting equipment used to represent a connection to ground which is typically used to compensate earth faults. @@ -28,9 +27,11 @@ class EarthFaultCompensator(ConductingEquipment): r: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EnergyArea.py b/pycgmes/resources/EnergyArea.py index e0231b2d..c20c2ccb 100644 --- a/pycgmes/resources/EnergyArea.py +++ b/pycgmes/resources/EnergyArea.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class EnergyArea(IdentifiedObject): """ Describes an area having energy production or consumption. Specializations are intended to support the load @@ -27,8 +26,8 @@ class EnergyArea(IdentifiedObject): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # ControlArea : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:0..1 in CIM + # ControlArea : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/EnergyConnection.py b/pycgmes/resources/EnergyConnection.py index 4d44430f..d6b48be2 100644 --- a/pycgmes/resources/EnergyConnection.py +++ b/pycgmes/resources/EnergyConnection.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class EnergyConnection(ConductingEquipment): """ A connection of energy generation or consumption on the power system model. diff --git a/pycgmes/resources/EnergyConsumer.py b/pycgmes/resources/EnergyConsumer.py index 7b5802e1..2d63f505 100644 --- a/pycgmes/resources/EnergyConsumer.py +++ b/pycgmes/resources/EnergyConsumer.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConnection import EnergyConnection -@dataclass(config=DataclassConfig) +@dataclass class EnergyConsumer(EnergyConnection): """ Generic user of energy - a point of consumption on the power system model. EnergyConsumer.pfixed, .qfixed, @@ -42,58 +41,74 @@ class EnergyConsumer(EnergyConnection): pfixed: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pfixedPct: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qfixed: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qfixedPct: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) LoadResponse: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) LoadDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EnergySchedulingType.py b/pycgmes/resources/EnergySchedulingType.py index e70b2ed2..528f858b 100644 --- a/pycgmes/resources/EnergySchedulingType.py +++ b/pycgmes/resources/EnergySchedulingType.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class EnergySchedulingType(IdentifiedObject): """ Used to define the type of generation for scheduling purposes. @@ -24,8 +23,8 @@ class EnergySchedulingType(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # EnergySource : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # EnergySource : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/EnergySource.py b/pycgmes/resources/EnergySource.py index 06d472be..279583c9 100644 --- a/pycgmes/resources/EnergySource.py +++ b/pycgmes/resources/EnergySource.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConnection import EnergyConnection -@dataclass(config=DataclassConfig) +@dataclass class EnergySource(EnergyConnection): """ A generic equivalent for an energy supplier on a transmission or distribution voltage level. @@ -50,100 +49,128 @@ class EnergySource(EnergyConnection): EnergySchedulingType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) nominalVoltage: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pMin: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pMax: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) rn: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) xn: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) activePower: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) reactivePower: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) voltageAngle: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) voltageMagnitude: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Equipment.py b/pycgmes/resources/Equipment.py index 7aeda7cc..0b101a48 100644 --- a/pycgmes/resources/Equipment.py +++ b/pycgmes/resources/Equipment.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class Equipment(PowerSystemResource): """ The parts of a power system that are physical devices, electronic or mechanical. @@ -43,35 +42,43 @@ class Equipment(PowerSystemResource): EquipmentContainer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) aggregate: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) normallyInService: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # OperationalLimitSet : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # OperationalLimitSet : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 inService: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EquipmentContainer.py b/pycgmes/resources/EquipmentContainer.py index 2c7e212a..e67b24e2 100644 --- a/pycgmes/resources/EquipmentContainer.py +++ b/pycgmes/resources/EquipmentContainer.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConnectivityNodeContainer import ConnectivityNodeContainer -@dataclass(config=DataclassConfig) +@dataclass class EquipmentContainer(ConnectivityNodeContainer): """ A modelling construct to provide a root class for containing equipment. @@ -24,8 +23,8 @@ class EquipmentContainer(ConnectivityNodeContainer): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Equipments : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Equipments : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/EquivalentBranch.py b/pycgmes/resources/EquivalentBranch.py index d870540b..c7a00f16 100644 --- a/pycgmes/resources/EquivalentBranch.py +++ b/pycgmes/resources/EquivalentBranch.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquivalentEquipment import EquivalentEquipment -@dataclass(config=DataclassConfig) +@dataclass class EquivalentBranch(EquivalentEquipment): """ The class represents equivalent branches. In cases where a transformer phase shift is modelled and the @@ -73,114 +72,146 @@ class EquivalentBranch(EquivalentEquipment): r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r21: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x21: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) negativeR12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) negativeR21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) negativeX12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) negativeX21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) positiveR12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) positiveR21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) positiveX12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) positiveX21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) zeroR12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) zeroR21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) zeroX12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) zeroX21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EquivalentEquipment.py b/pycgmes/resources/EquivalentEquipment.py index 21244d2a..98a93654 100644 --- a/pycgmes/resources/EquivalentEquipment.py +++ b/pycgmes/resources/EquivalentEquipment.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class EquivalentEquipment(ConductingEquipment): """ The class represents equivalent objects that are the result of a network reduction. The class is the base for @@ -28,9 +27,11 @@ class EquivalentEquipment(ConductingEquipment): EquivalentNetwork: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EquivalentInjection.py b/pycgmes/resources/EquivalentInjection.py index 1fe78bc7..d28ef2a7 100644 --- a/pycgmes/resources/EquivalentInjection.py +++ b/pycgmes/resources/EquivalentInjection.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquivalentEquipment import EquivalentEquipment -@dataclass(config=DataclassConfig) +@dataclass class EquivalentInjection(EquivalentEquipment): """ This class represents equivalent injections (generation or load). Voltage regulation is allowed only at the point @@ -57,114 +56,146 @@ class EquivalentInjection(EquivalentEquipment): maxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) regulationCapability: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ReactiveCapabilityCurve: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r2: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x2: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) regulationStatus: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) regulationTarget: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/EquivalentNetwork.py b/pycgmes/resources/EquivalentNetwork.py index 12b98617..2081e083 100644 --- a/pycgmes/resources/EquivalentNetwork.py +++ b/pycgmes/resources/EquivalentNetwork.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConnectivityNodeContainer import ConnectivityNodeContainer -@dataclass(config=DataclassConfig) +@dataclass class EquivalentNetwork(ConnectivityNodeContainer): """ A class that groups electrical equivalents, including internal nodes, of a network that has been reduced. The @@ -26,8 +25,8 @@ class EquivalentNetwork(ConnectivityNodeContainer): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # EquivalentEquipments : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # EquivalentEquipments : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/EquivalentShunt.py b/pycgmes/resources/EquivalentShunt.py index 69f4ea7c..3b614cca 100644 --- a/pycgmes/resources/EquivalentShunt.py +++ b/pycgmes/resources/EquivalentShunt.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquivalentEquipment import EquivalentEquipment -@dataclass(config=DataclassConfig) +@dataclass class EquivalentShunt(EquivalentEquipment): """ The class represents equivalent shunts. @@ -27,16 +26,20 @@ class EquivalentShunt(EquivalentEquipment): b: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) g: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC1A.py b/pycgmes/resources/ExcAC1A.py index 11c5dddc..2fbf2f69 100644 --- a/pycgmes/resources/ExcAC1A.py +++ b/pycgmes/resources/ExcAC1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC1A(ExcitationSystemDynamics): """ Modified IEEE AC1A alternator-supplied rectifier excitation system with different rate feedback source. @@ -52,156 +51,200 @@ class ExcAC1A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hvlvgates: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC2A.py b/pycgmes/resources/ExcAC2A.py index 741251f8..c0d9b1ed 100644 --- a/pycgmes/resources/ExcAC2A.py +++ b/pycgmes/resources/ExcAC2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC2A(ExcitationSystemDynamics): """ Modified IEEE AC2A alternator-supplied rectifier excitation system with different field current limit. @@ -58,198 +57,254 @@ class ExcAC2A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kb1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hvgate: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lvgate: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC3A.py b/pycgmes/resources/ExcAC3A.py index 9e07294c..fcdcb0c7 100644 --- a/pycgmes/resources/ExcAC3A.py +++ b/pycgmes/resources/ExcAC3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC3A(ExcitationSystemDynamics): """ Modified IEEE AC3A alternator-supplied rectifier excitation system with different field current limit. @@ -55,184 +54,236 @@ class ExcAC3A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC4A.py b/pycgmes/resources/ExcAC4A.py index bacde61b..3df7009a 100644 --- a/pycgmes/resources/ExcAC4A.py +++ b/pycgmes/resources/ExcAC4A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC4A(ExcitationSystemDynamics): """ Modified IEEE AC4A alternator-supplied rectifier excitation system with different minimum controller output. @@ -34,65 +33,83 @@ class ExcAC4A(ExcitationSystemDynamics): vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC5A.py b/pycgmes/resources/ExcAC5A.py index ddd12ea2..7d2de02b 100644 --- a/pycgmes/resources/ExcAC5A.py +++ b/pycgmes/resources/ExcAC5A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC5A(ExcitationSystemDynamics): """ Modified IEEE AC5A alternator-supplied rectifier excitation system with different minimum controller output. @@ -45,128 +44,164 @@ class ExcAC5A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC6A.py b/pycgmes/resources/ExcAC6A.py index d8c6c001..a2519ec3 100644 --- a/pycgmes/resources/ExcAC6A.py +++ b/pycgmes/resources/ExcAC6A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC6A(ExcitationSystemDynamics): """ Modified IEEE AC6A alternator-supplied rectifier excitation system with speed input. @@ -52,163 +51,209 @@ class ExcAC6A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tk: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tj: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfelim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vhmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAC8B.py b/pycgmes/resources/ExcAC8B.py index 1a29bb7f..ec8df1b0 100644 --- a/pycgmes/resources/ExcAC8B.py +++ b/pycgmes/resources/ExcAC8B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAC8B(ExcitationSystemDynamics): """ Modified IEEE AC8B alternator-supplied rectifier excitation system with speed input and input limiter. @@ -61,191 +60,245 @@ class ExcAC8B(ExcitationSystemDynamics): inlim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pidlim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) telim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpidmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpidmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtmult: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcANS.py b/pycgmes/resources/ExcANS.py index 45abddb2..230daa37 100644 --- a/pycgmes/resources/ExcANS.py +++ b/pycgmes/resources/ExcANS.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcANS(ExcitationSystemDynamics): """ Italian excitation system. It represents static field voltage or excitation current feedback excitation system. @@ -41,100 +40,128 @@ class ExcANS(ExcitationSystemDynamics): k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kce: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) blint: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kvfif: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) krvecc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR1.py b/pycgmes/resources/ExcAVR1.py index db09653b..22379148 100644 --- a/pycgmes/resources/ExcAVR1.py +++ b/pycgmes/resources/ExcAVR1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR1(ExcitationSystemDynamics): """ Italian excitation system corresponding to IEEE (1968) type 1 model. It represents an exciter dynamo and @@ -38,86 +37,110 @@ class ExcAVR1(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR2.py b/pycgmes/resources/ExcAVR2.py index cb718d43..533b09df 100644 --- a/pycgmes/resources/ExcAVR2.py +++ b/pycgmes/resources/ExcAVR2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR2(ExcitationSystemDynamics): """ Italian excitation system corresponding to IEEE (1968) type 2 model. It represents an alternator and rotating diodes @@ -39,93 +38,119 @@ class ExcAVR2(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR3.py b/pycgmes/resources/ExcAVR3.py index b68f9a20..186d7a55 100644 --- a/pycgmes/resources/ExcAVR3.py +++ b/pycgmes/resources/ExcAVR3.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR3(ExcitationSystemDynamics): """ Italian excitation system. It represents an exciter dynamo and electric regulator. @@ -37,86 +36,110 @@ class ExcAVR3(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR4.py b/pycgmes/resources/ExcAVR4.py index ff2991b2..c434ebf4 100644 --- a/pycgmes/resources/ExcAVR4.py +++ b/pycgmes/resources/ExcAVR4.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR4(ExcitationSystemDynamics): """ Italian excitation system. It represents a static exciter and electric voltage regulator. @@ -40,100 +39,128 @@ class ExcAVR4(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kif: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tif: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1if: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) imul: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR5.py b/pycgmes/resources/ExcAVR5.py index 1ace83e0..e15dc66a 100644 --- a/pycgmes/resources/ExcAVR5.py +++ b/pycgmes/resources/ExcAVR5.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR5(ExcitationSystemDynamics): """ Manual excitation control with field circuit resistance. This model can be used as a very simple representation of @@ -30,23 +29,29 @@ class ExcAVR5(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rex: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcAVR7.py b/pycgmes/resources/ExcAVR7.py index 17e29775..7ba1a338 100644 --- a/pycgmes/resources/ExcAVR7.py +++ b/pycgmes/resources/ExcAVR7.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcAVR7(ExcitationSystemDynamics): """ IVO excitation system. @@ -46,149 +45,191 @@ class ExcAVR7(ExcitationSystemDynamics): k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcBBC.py b/pycgmes/resources/ExcBBC.py index 73b294d5..34f6f259 100644 --- a/pycgmes/resources/ExcBBC.py +++ b/pycgmes/resources/ExcBBC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcBBC(ExcitationSystemDynamics): """ Transformer fed static excitation system (static with ABB regulator). This model represents a static excitation @@ -40,79 +39,101 @@ class ExcBBC(ExcitationSystemDynamics): t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xe: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) switch: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcCZ.py b/pycgmes/resources/ExcCZ.py index 2d5b70e0..648e3cd2 100644 --- a/pycgmes/resources/ExcCZ.py +++ b/pycgmes/resources/ExcCZ.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcCZ(ExcitationSystemDynamics): """ Czech proportion/integral exciter. @@ -35,72 +34,92 @@ class ExcCZ(ExcitationSystemDynamics): kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcDC1A.py b/pycgmes/resources/ExcDC1A.py index e8c94af8..c25035dc 100644 --- a/pycgmes/resources/ExcDC1A.py +++ b/pycgmes/resources/ExcDC1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcDC1A(ExcitationSystemDynamics): """ Modified IEEE DC1A direct current commutator exciter with speed input and without underexcitation limiters (UEL) @@ -48,128 +47,164 @@ class ExcDC1A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcDC2A.py b/pycgmes/resources/ExcDC2A.py index 00a245be..7e7a82de 100644 --- a/pycgmes/resources/ExcDC2A.py +++ b/pycgmes/resources/ExcDC2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcDC2A(ExcitationSystemDynamics): """ Modified IEEE DC2A direct current commutator exciter with speed input, one more leg block in feedback loop and @@ -52,128 +51,164 @@ class ExcDC2A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtlim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcDC3A.py b/pycgmes/resources/ExcDC3A.py index 7ed96891..f0f9c8f2 100644 --- a/pycgmes/resources/ExcDC3A.py +++ b/pycgmes/resources/ExcDC3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcDC3A(ExcitationSystemDynamics): """ Modified IEEE DC3A direct current commutator exciter with speed input, and deadband. DC old type 4. @@ -46,114 +45,146 @@ class ExcDC3A(ExcitationSystemDynamics): trh: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdlim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcDC3A1.py b/pycgmes/resources/ExcDC3A1.py index 44bad546..e96cf751 100644 --- a/pycgmes/resources/ExcDC3A1.py +++ b/pycgmes/resources/ExcDC3A1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcDC3A1(ExcitationSystemDynamics): """ Modified old IEEE type 3 excitation system. @@ -40,100 +39,128 @@ class ExcDC3A1(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vbmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vb1max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vblim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcELIN1.py b/pycgmes/resources/ExcELIN1.py index 0931eddb..b1cee8b4 100644 --- a/pycgmes/resources/ExcELIN1.py +++ b/pycgmes/resources/ExcELIN1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcELIN1(ExcitationSystemDynamics): """ Static PI transformer fed excitation system ELIN (VATECH) - simplified model. This model represents an all-static @@ -44,107 +43,137 @@ class ExcELIN1(ExcitationSystemDynamics): tfi: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tnu: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpnf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpnf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xe: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) smax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcELIN2.py b/pycgmes/resources/ExcELIN2.py index 4026266f..9fd63298 100644 --- a/pycgmes/resources/ExcELIN2.py +++ b/pycgmes/resources/ExcELIN2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcELIN2(ExcitationSystemDynamics): """ Detailed excitation system ELIN (VATECH). This model represents an all-static excitation system. A PI voltage @@ -59,191 +58,245 @@ class ExcELIN2(ExcitationSystemDynamics): k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1ec: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pid1max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iefmax2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ketb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) upmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) upmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdbas: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcHU.py b/pycgmes/resources/ExcHU.py index 180185c1..99cd1b93 100644 --- a/pycgmes/resources/ExcHU.py +++ b/pycgmes/resources/ExcHU.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcHU(ExcitationSystemDynamics): """ Hungarian excitation system, with built-in voltage transducer. @@ -38,86 +37,110 @@ class ExcHU(ExcitationSystemDynamics): tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) imin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) imax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ae: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ai: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) atr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC1A.py b/pycgmes/resources/ExcIEEEAC1A.py index 088bed6d..9eb06616 100644 --- a/pycgmes/resources/ExcIEEEAC1A.py +++ b/pycgmes/resources/ExcIEEEAC1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC1A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC1A model. The model represents the field-controlled alternator-rectifier excitation systems @@ -49,128 +48,164 @@ class ExcIEEEAC1A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC2A.py b/pycgmes/resources/ExcIEEEAC2A.py index 032342f6..0b03b354 100644 --- a/pycgmes/resources/ExcIEEEAC2A.py +++ b/pycgmes/resources/ExcIEEEAC2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC2A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC2A model. The model represents a high initial response field-controlled alternator-rectifier @@ -53,149 +52,191 @@ class ExcIEEEAC2A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC3A.py b/pycgmes/resources/ExcIEEEAC3A.py index 9892f37b..96239ed2 100644 --- a/pycgmes/resources/ExcIEEEAC3A.py +++ b/pycgmes/resources/ExcIEEEAC3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC3A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC3A model. The model represents the field-controlled alternator-rectifier excitation systems @@ -56,149 +55,191 @@ class ExcIEEEAC3A(ExcitationSystemDynamics): tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC4A.py b/pycgmes/resources/ExcIEEEAC4A.py index e9ce4a2d..118c7926 100644 --- a/pycgmes/resources/ExcIEEEAC4A.py +++ b/pycgmes/resources/ExcIEEEAC4A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC4A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC4A model. The model represents type AC4A alternator-supplied controlled-rectifier excitation @@ -39,65 +38,83 @@ class ExcIEEEAC4A(ExcitationSystemDynamics): vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC5A.py b/pycgmes/resources/ExcIEEEAC5A.py index 36099303..4d5ee8cf 100644 --- a/pycgmes/resources/ExcIEEEAC5A.py +++ b/pycgmes/resources/ExcIEEEAC5A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC5A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC5A model. The model represents a simplified model for brushless excitation systems. The @@ -46,100 +45,128 @@ class ExcIEEEAC5A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC6A.py b/pycgmes/resources/ExcIEEEAC6A.py index 1e732f40..c7242156 100644 --- a/pycgmes/resources/ExcIEEEAC6A.py +++ b/pycgmes/resources/ExcIEEEAC6A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC6A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC6A model. The model represents field-controlled alternator-rectifier excitation systems with @@ -54,156 +53,200 @@ class ExcIEEEAC6A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tk: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tj: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfelim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vhmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC7B.py b/pycgmes/resources/ExcIEEEAC7B.py index 70590b16..02c187ca 100644 --- a/pycgmes/resources/ExcIEEEAC7B.py +++ b/pycgmes/resources/ExcIEEEAC7B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC7B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC7B model. The model represents excitation systems which consist of an AC alternator with @@ -59,184 +58,236 @@ class ExcIEEEAC7B(ExcitationSystemDynamics): kpr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpa: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kia: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEAC8B.py b/pycgmes/resources/ExcIEEEAC8B.py index 332c7b89..3360caff 100644 --- a/pycgmes/resources/ExcIEEEAC8B.py +++ b/pycgmes/resources/ExcIEEEAC8B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEAC8B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type AC8B model. This model represents a PID voltage regulator with either a brushless exciter or DC @@ -54,128 +53,164 @@ class ExcIEEEAC8B(ExcitationSystemDynamics): kpr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfemax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seve2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEDC1A.py b/pycgmes/resources/ExcIEEEDC1A.py index 1b734592..6d086d67 100644 --- a/pycgmes/resources/ExcIEEEDC1A.py +++ b/pycgmes/resources/ExcIEEEDC1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEDC1A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type DC1A model. This model represents field-controlled DC commutator exciters with continuously @@ -50,114 +49,146 @@ class ExcIEEEDC1A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEDC2A.py b/pycgmes/resources/ExcIEEEDC2A.py index 39f4f7a2..e9d9ee88 100644 --- a/pycgmes/resources/ExcIEEEDC2A.py +++ b/pycgmes/resources/ExcIEEEDC2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEDC2A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type DC2A model. This model represents field-controlled DC commutator exciters with continuously @@ -49,114 +48,146 @@ class ExcIEEEDC2A(ExcitationSystemDynamics): efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEDC3A.py b/pycgmes/resources/ExcIEEEDC3A.py index c08b5469..a60a312a 100644 --- a/pycgmes/resources/ExcIEEEDC3A.py +++ b/pycgmes/resources/ExcIEEEDC3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEDC3A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type DC3A model. This model represents older systems, in particular those DC commutator exciters @@ -46,79 +45,101 @@ class ExcIEEEDC3A(ExcitationSystemDynamics): trh: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exclim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEDC4B.py b/pycgmes/resources/ExcIEEEDC4B.py index b6d94e4d..67a5a738 100644 --- a/pycgmes/resources/ExcIEEEDC4B.py +++ b/pycgmes/resources/ExcIEEEDC4B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEDC4B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type DC4B model. These excitation systems utilize a field-controlled DC commutator exciter with a @@ -48,135 +47,173 @@ class ExcIEEEDC4B(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) seefd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) oelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST1A.py b/pycgmes/resources/ExcIEEEST1A.py index fe05b046..222ad89e 100644 --- a/pycgmes/resources/ExcIEEEST1A.py +++ b/pycgmes/resources/ExcIEEEST1A.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST1A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST1A model. This model represents systems in which excitation power is supplied through a @@ -49,135 +48,173 @@ class ExcIEEEST1A(ExcitationSystemDynamics): ilr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pssin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST1AUELselectorKind.py b/pycgmes/resources/ExcIEEEST1AUELselectorKind.py index 9bd1a8c0..373d4346 100644 --- a/pycgmes/resources/ExcIEEEST1AUELselectorKind.py +++ b/pycgmes/resources/ExcIEEEST1AUELselectorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST1AUELselectorKind(Base): """ Types of connections for the UEL input used in ExcIEEEST1A. diff --git a/pycgmes/resources/ExcIEEEST2A.py b/pycgmes/resources/ExcIEEEST2A.py index ff4e2a4d..cd66f43c 100644 --- a/pycgmes/resources/ExcIEEEST2A.py +++ b/pycgmes/resources/ExcIEEEST2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST2A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST2A model. Some static systems use both current and voltage sources (generator terminal @@ -41,93 +40,119 @@ class ExcIEEEST2A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST3A.py b/pycgmes/resources/ExcIEEEST3A.py index 36aca277..bf45f931 100644 --- a/pycgmes/resources/ExcIEEEST3A.py +++ b/pycgmes/resources/ExcIEEEST3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST3A(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST3A model. Some static systems utilize a field voltage control loop to linearize the exciter @@ -52,142 +51,182 @@ class ExcIEEEST3A(ExcitationSystemDynamics): vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetap: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vbmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vgmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST4B.py b/pycgmes/resources/ExcIEEEST4B.py index 81cc7ebc..f1321046 100644 --- a/pycgmes/resources/ExcIEEEST4B.py +++ b/pycgmes/resources/ExcIEEEST4B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST4B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST4B model. This model is a variation of the type ST3A model, with a proportional plus integral @@ -45,114 +44,146 @@ class ExcIEEEST4B(ExcitationSystemDynamics): kpr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetap: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vbmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST5B.py b/pycgmes/resources/ExcIEEEST5B.py index ecf19668..4141ecf8 100644 --- a/pycgmes/resources/ExcIEEEST5B.py +++ b/pycgmes/resources/ExcIEEEST5B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST5B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST5B model. The type ST5B excitation system is a variation of the type ST1A model, with @@ -45,121 +44,155 @@ class ExcIEEEST5B(ExcitationSystemDynamics): kr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) toc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tob1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) toc2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tob2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tuc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tub1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tuc2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tub2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST6B.py b/pycgmes/resources/ExcIEEEST6B.py index fe202701..2a421e53 100644 --- a/pycgmes/resources/ExcIEEEST6B.py +++ b/pycgmes/resources/ExcIEEEST6B.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST6B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST6B model. This model consists of a PI voltage regulator with an inner loop field voltage @@ -42,100 +41,128 @@ class ExcIEEEST6B(ExcitationSystemDynamics): ilr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kci: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kff: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kia: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpa: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) oelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcIEEEST7B.py b/pycgmes/resources/ExcIEEEST7B.py index b9219ae9..78a32125 100644 --- a/pycgmes/resources/ExcIEEEST7B.py +++ b/pycgmes/resources/ExcIEEEST7B.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcIEEEST7B(ExcitationSystemDynamics): """ IEEE 421.5-2005 type ST7B model. This model is representative of static potential-source excitation systems. In this @@ -49,107 +48,137 @@ class ExcIEEEST7B(ExcitationSystemDynamics): kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kia: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpa: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) oelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tia: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcNI.py b/pycgmes/resources/ExcNI.py index 6e154865..858ebe47 100644 --- a/pycgmes/resources/ExcNI.py +++ b/pycgmes/resources/ExcNI.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcNI(ExcitationSystemDynamics): """ Bus or solid fed SCR (silicon-controlled rectifier) bridge excitation system model type NI (NVE). @@ -37,72 +36,92 @@ class ExcNI(ExcitationSystemDynamics): busFedSelector: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcOEX3T.py b/pycgmes/resources/ExcOEX3T.py index fd141150..e2ecd97f 100644 --- a/pycgmes/resources/ExcOEX3T.py +++ b/pycgmes/resources/ExcOEX3T.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcOEX3T(ExcitationSystemDynamics): """ Modified IEEE type ST1 excitation system with semi-continuous and acting terminal voltage limiter. @@ -44,135 +43,173 @@ class ExcOEX3T(ExcitationSystemDynamics): t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) see1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) see2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcPIC.py b/pycgmes/resources/ExcPIC.py index dfa3bbc6..89fcb57c 100644 --- a/pycgmes/resources/ExcPIC.py +++ b/pycgmes/resources/ExcPIC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcPIC(ExcitationSystemDynamics): """ Proportional/integral regulator excitation system. This model can be used to represent excitation systems with a @@ -49,163 +48,209 @@ class ExcPIC(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vr1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vr2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcREXS.py b/pycgmes/resources/ExcREXS.py index c858dbc9..f5e2acc5 100644 --- a/pycgmes/resources/ExcREXS.py +++ b/pycgmes/resources/ExcREXS.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcREXS(ExcitationSystemDynamics): """ General purpose rotating excitation system. This model can be used to represent a wide range of excitation systems @@ -64,254 +63,326 @@ class ExcREXS(ExcitationSystemDynamics): e1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fbf: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flimf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kefd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kii: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kvi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kvp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kvphz: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) nvphz: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) se2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vfmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcREXSFeedbackSignalKind.py b/pycgmes/resources/ExcREXSFeedbackSignalKind.py index b9b9adb8..afd552f2 100644 --- a/pycgmes/resources/ExcREXSFeedbackSignalKind.py +++ b/pycgmes/resources/ExcREXSFeedbackSignalKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ExcREXSFeedbackSignalKind(Base): """ Types of rate feedback signals. diff --git a/pycgmes/resources/ExcRQB.py b/pycgmes/resources/ExcRQB.py index 69d194b2..bab22102 100644 --- a/pycgmes/resources/ExcRQB.py +++ b/pycgmes/resources/ExcRQB.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcRQB(ExcitationSystemDynamics): """ Excitation system type RQB (four-loop regulator, r?gulateur quatre boucles, developed in France) primarily used in @@ -40,93 +39,119 @@ class ExcRQB(ExcitationSystemDynamics): ki0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ucmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ucmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lus: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klus: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mesu: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4m: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lsat: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcSCRX.py b/pycgmes/resources/ExcSCRX.py index 88b37f93..d6bf2d09 100644 --- a/pycgmes/resources/ExcSCRX.py +++ b/pycgmes/resources/ExcSCRX.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcSCRX(ExcitationSystemDynamics): """ Simple excitation system with generic characteristics typical of many excitation systems; intended for use where @@ -35,58 +34,74 @@ class ExcSCRX(ExcitationSystemDynamics): tatb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cswitch: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rcrfd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcSEXS.py b/pycgmes/resources/ExcSEXS.py index b51106f5..7df38954 100644 --- a/pycgmes/resources/ExcSEXS.py +++ b/pycgmes/resources/ExcSEXS.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcSEXS(ExcitationSystemDynamics): """ Simplified excitation system. @@ -35,72 +34,92 @@ class ExcSEXS(ExcitationSystemDynamics): tatb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcSK.py b/pycgmes/resources/ExcSK.py index 0b5359ab..7d055462 100644 --- a/pycgmes/resources/ExcSK.py +++ b/pycgmes/resources/ExcSK.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcSK(ExcitationSystemDynamics): """ Slovakian excitation system. UEL and secondary voltage control are included in this model. When this model is used, @@ -63,226 +62,290 @@ class ExcSK(ExcitationSystemDynamics): efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kce: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kgob: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kqi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kqob: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kqp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) nq: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qconoff: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qz: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) remote: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) sbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) urmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) urmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vtmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) yp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST1A.py b/pycgmes/resources/ExcST1A.py index 40bbe067..49679d7a 100644 --- a/pycgmes/resources/ExcST1A.py +++ b/pycgmes/resources/ExcST1A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST1A(ExcitationSystemDynamics): """ Modification of an old IEEE ST1A static excitation system without overexcitation limiter (OEL) and underexcitation @@ -44,128 +43,164 @@ class ExcST1A(ExcitationSystemDynamics): vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ilr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xe: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST2A.py b/pycgmes/resources/ExcST2A.py index b0b00258..3498cd70 100644 --- a/pycgmes/resources/ExcST2A.py +++ b/pycgmes/resources/ExcST2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST2A(ExcitationSystemDynamics): """ Modified IEEE ST2A static excitation system with another lead-lag block added to match the model defined by WECC. @@ -40,107 +39,137 @@ class ExcST2A(ExcitationSystemDynamics): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST3A.py b/pycgmes/resources/ExcST3A.py index ab939936..025ea701 100644 --- a/pycgmes/resources/ExcST3A.py +++ b/pycgmes/resources/ExcST3A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST3A(ExcitationSystemDynamics): """ Modified IEEE ST3A static excitation system with added speed multiplier. @@ -45,142 +44,182 @@ class ExcST3A(ExcitationSystemDynamics): vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kj: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetap: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vbmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vgmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST4B.py b/pycgmes/resources/ExcST4B.py index a663cba7..fae0facd 100644 --- a/pycgmes/resources/ExcST4B.py +++ b/pycgmes/resources/ExcST4B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST4B(ExcitationSystemDynamics): """ Modified IEEE ST4B static excitation system with maximum inner loop feedback gain Vgmax. @@ -46,135 +45,173 @@ class ExcST4B(ExcitationSystemDynamics): kpr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kir: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetap: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vbmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vgmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uel: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lvgate: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST6B.py b/pycgmes/resources/ExcST6B.py index 3ded7c9f..19949367 100644 --- a/pycgmes/resources/ExcST6B.py +++ b/pycgmes/resources/ExcST6B.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST6B(ExcitationSystemDynamics): """ Modified IEEE ST6B static excitation system with PID controller and optional inner feedback loop. @@ -51,163 +50,209 @@ class ExcST6B(ExcitationSystemDynamics): ilr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kff: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kia: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpa: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kvd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) oelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tvd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vilim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmult: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST6BOELselectorKind.py b/pycgmes/resources/ExcST6BOELselectorKind.py index 3afc987d..8e6a6eaa 100644 --- a/pycgmes/resources/ExcST6BOELselectorKind.py +++ b/pycgmes/resources/ExcST6BOELselectorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ExcST6BOELselectorKind(Base): """ Types of connections for the OEL input used for static excitation systems type 6B. diff --git a/pycgmes/resources/ExcST7B.py b/pycgmes/resources/ExcST7B.py index 74d3fc55..23eacee0 100644 --- a/pycgmes/resources/ExcST7B.py +++ b/pycgmes/resources/ExcST7B.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcST7B(ExcitationSystemDynamics): """ Modified IEEE ST7B static excitation system without stator current limiter (SCL) and current compensator (DROOP) @@ -43,114 +42,146 @@ class ExcST7B(ExcitationSystemDynamics): kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kia: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpa: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) oelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tia: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uelin: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ExcST7BOELselectorKind.py b/pycgmes/resources/ExcST7BOELselectorKind.py index 8279eaff..7fcc36fa 100644 --- a/pycgmes/resources/ExcST7BOELselectorKind.py +++ b/pycgmes/resources/ExcST7BOELselectorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ExcST7BOELselectorKind(Base): """ Types of connections for the OEL input used for static excitation systems type 7B. diff --git a/pycgmes/resources/ExcST7BUELselectorKind.py b/pycgmes/resources/ExcST7BUELselectorKind.py index 0a856784..65f1b616 100644 --- a/pycgmes/resources/ExcST7BUELselectorKind.py +++ b/pycgmes/resources/ExcST7BUELselectorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ExcST7BUELselectorKind(Base): """ Types of connections for the UEL input used for static excitation systems type 7B. diff --git a/pycgmes/resources/ExcitationSystemDynamics.py b/pycgmes/resources/ExcitationSystemDynamics.py index 85d584ea..236726d0 100644 --- a/pycgmes/resources/ExcitationSystemDynamics.py +++ b/pycgmes/resources/ExcitationSystemDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class ExcitationSystemDynamics(DynamicsFunctionBlock): """ Excitation system function block whose behaviour is described by reference to a standard model or by definition of a @@ -38,38 +37,40 @@ class ExcitationSystemDynamics(DynamicsFunctionBlock): SynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # VoltageCompensatorDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # VoltageCompensatorDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # OverexcitationLimiterDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # OverexcitationLimiterDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # PFVArControllerType2Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # PFVArControllerType2Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # DiscontinuousExcitationControlDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) # noqa: E501 + # Type M:0..1 in CIM + # DiscontinuousExcitationControlDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # PowerSystemStabilizerDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # PowerSystemStabilizerDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # UnderexcitationLimiterDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # UnderexcitationLimiterDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # PFVArControllerType1Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # PFVArControllerType1Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ExcitationSystemUserDefined.py b/pycgmes/resources/ExcitationSystemUserDefined.py index e7e9960e..aec02916 100644 --- a/pycgmes/resources/ExcitationSystemUserDefined.py +++ b/pycgmes/resources/ExcitationSystemUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ExcitationSystemDynamics import ExcitationSystemDynamics -@dataclass(config=DataclassConfig) +@dataclass class ExcitationSystemUserDefined(ExcitationSystemDynamics): """ Excitation system function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class ExcitationSystemUserDefined(ExcitationSystemDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ExternalNetworkInjection.py b/pycgmes/resources/ExternalNetworkInjection.py index fd9c5708..1e096e2e 100644 --- a/pycgmes/resources/ExternalNetworkInjection.py +++ b/pycgmes/resources/ExternalNetworkInjection.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingCondEq import RegulatingCondEq -@dataclass(config=DataclassConfig) +@dataclass class ExternalNetworkInjection(RegulatingCondEq): """ This class represents the external network and it is used for IEC 60909 calculations. @@ -60,128 +59,164 @@ class ExternalNetworkInjection(RegulatingCondEq): governorSCD: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ikSecond: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) maxInitialSymShCCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) maxR0ToX0Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) maxR1ToX1Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) maxZ0ToZ1Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) minInitialSymShCCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) minR0ToX0Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) minR1ToX1Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) minZ0ToZ1Ratio: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) voltageFactor: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) referencePriority: int = Field( default=0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/FaultIndicator.py b/pycgmes/resources/FaultIndicator.py index df81d953..249a4626 100644 --- a/pycgmes/resources/FaultIndicator.py +++ b/pycgmes/resources/FaultIndicator.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AuxiliaryEquipment import AuxiliaryEquipment -@dataclass(config=DataclassConfig) +@dataclass class FaultIndicator(AuxiliaryEquipment): """ A FaultIndicator is typically only an indicator (which may or may not be remotely monitored), and not a piece of diff --git a/pycgmes/resources/Float.py b/pycgmes/resources/Float.py index e03bbe17..f883f427 100644 --- a/pycgmes/resources/Float.py +++ b/pycgmes/resources/Float.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Float(Base): """ A floating point number. The range is unspecified and not limited. diff --git a/pycgmes/resources/FossilFuel.py b/pycgmes/resources/FossilFuel.py index 6a86df77..1773b055 100644 --- a/pycgmes/resources/FossilFuel.py +++ b/pycgmes/resources/FossilFuel.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class FossilFuel(IdentifiedObject): """ The fossil fuel consumed by the non-nuclear thermal generating unit. For example, coal, oil, gas, etc. These are @@ -29,16 +28,20 @@ class FossilFuel(IdentifiedObject): fossilFuelType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ThermalGeneratingUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/FrancisGovernorControlKind.py b/pycgmes/resources/FrancisGovernorControlKind.py index 75d0dd4a..18f4d879 100644 --- a/pycgmes/resources/FrancisGovernorControlKind.py +++ b/pycgmes/resources/FrancisGovernorControlKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class FrancisGovernorControlKind(Base): """ Governor control flag for Francis hydro model. diff --git a/pycgmes/resources/Frequency.py b/pycgmes/resources/Frequency.py index 55244712..bd911a3e 100644 --- a/pycgmes/resources/Frequency.py +++ b/pycgmes/resources/Frequency.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Frequency(Base): """ Cycles per second. @@ -29,26 +28,32 @@ class Frequency(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/FuelType.py b/pycgmes/resources/FuelType.py index 2a0ac763..c1e65981 100644 --- a/pycgmes/resources/FuelType.py +++ b/pycgmes/resources/FuelType.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class FuelType(Base): """ Type of fuel. diff --git a/pycgmes/resources/Fuse.py b/pycgmes/resources/Fuse.py index 4fcbb934..409fe6b6 100644 --- a/pycgmes/resources/Fuse.py +++ b/pycgmes/resources/Fuse.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class Fuse(Switch): """ An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of diff --git a/pycgmes/resources/GenICompensationForGenJ.py b/pycgmes/resources/GenICompensationForGenJ.py index 8d373c50..b85201bf 100644 --- a/pycgmes/resources/GenICompensationForGenJ.py +++ b/pycgmes/resources/GenICompensationForGenJ.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class GenICompensationForGenJ(IdentifiedObject): """ Resistive and reactive components of compensation for generator associated with IEEE type 2 voltage compensator for @@ -33,30 +32,38 @@ class GenICompensationForGenJ(IdentifiedObject): SynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) VcompIEEEType2: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rcij: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xcij: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GeneratingUnit.py b/pycgmes/resources/GeneratingUnit.py index 68b36856..d110a6bb 100644 --- a/pycgmes/resources/GeneratingUnit.py +++ b/pycgmes/resources/GeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class GeneratingUnit(Equipment): """ A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, @@ -59,127 +58,159 @@ class GeneratingUnit(Equipment): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ControlAreaGeneratingUnit : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ControlAreaGeneratingUnit : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 genControlSource: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) governorSCD: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) longPF: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maximumAllowableSpinningReserve: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxOperatingP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minOperatingP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) nominalP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedGrossMaxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedGrossMinP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedNetMaxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) shortPF: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) startupCost: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) variableCost: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) startupTime: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) totalEfficiency: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # GrossToNetActivePowerCurves : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # GrossToNetActivePowerCurves : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # RotatingMachine : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # RotatingMachine : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 normalPF: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GeneratorControlSource.py b/pycgmes/resources/GeneratorControlSource.py index 4bd6bf91..6d2bbf7e 100644 --- a/pycgmes/resources/GeneratorControlSource.py +++ b/pycgmes/resources/GeneratorControlSource.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class GeneratorControlSource(Base): """ The source of controls for a generating unit. diff --git a/pycgmes/resources/GenericNonLinearLoadModelKind.py b/pycgmes/resources/GenericNonLinearLoadModelKind.py index 910de114..b7bdc13a 100644 --- a/pycgmes/resources/GenericNonLinearLoadModelKind.py +++ b/pycgmes/resources/GenericNonLinearLoadModelKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class GenericNonLinearLoadModelKind(Base): """ Type of generic non-linear load model. diff --git a/pycgmes/resources/GeographicalRegion.py b/pycgmes/resources/GeographicalRegion.py index ba7b6f3a..2204833c 100644 --- a/pycgmes/resources/GeographicalRegion.py +++ b/pycgmes/resources/GeographicalRegion.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class GeographicalRegion(IdentifiedObject): """ A geographical region of a power system network model. @@ -24,8 +23,8 @@ class GeographicalRegion(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Regions : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Regions : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/GovCT1.py b/pycgmes/resources/GovCT1.py index 80e826c4..c36d4702 100644 --- a/pycgmes/resources/GovCT1.py +++ b/pycgmes/resources/GovCT1.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovCT1(TurbineGovernorDynamics): """ General model for any prime mover with a PID governor, used primarily for combustion turbine and combined cycle @@ -82,247 +81,317 @@ class GovCT1(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rselect: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpelec: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) maxerr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) minerr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpgov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kigov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdgov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdgov: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tact: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfspd: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) teng: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tfload: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpload: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiload: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ldref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ropen: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rclose: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kimw: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aset: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsa: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rup: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rdown: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovCT2.py b/pycgmes/resources/GovCT2.py index 5eebba21..ca452072 100644 --- a/pycgmes/resources/GovCT2.py +++ b/pycgmes/resources/GovCT2.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovCT2(TurbineGovernorDynamics): """ General governor with frequency-dependent fuel flow limit. This model is a modification of the GovCT1 model in @@ -97,394 +96,506 @@ class GovCT2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rselect: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpelec: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) maxerr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) minerr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpgov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kigov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdgov: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdgov: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tact: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfspd: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) teng: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tfload: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpload: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiload: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ldref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ropen: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rclose: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kimw: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aset: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsa: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rup: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rdown: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) prate: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flim10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) plim10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGAST.py b/pycgmes/resources/GovGAST.py index 93db2401..6ab1f276 100644 --- a/pycgmes/resources/GovGAST.py +++ b/pycgmes/resources/GovGAST.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGAST(TurbineGovernorDynamics): """ Single shaft gas turbine. @@ -39,72 +38,92 @@ class GovGAST(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) at: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGAST1.py b/pycgmes/resources/GovGAST1.py index dfd98f9a..639c4a3d 100644 --- a/pycgmes/resources/GovGAST1.py +++ b/pycgmes/resources/GovGAST1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGAST1(TurbineGovernorDynamics): """ Modified single shaft gas turbine. @@ -65,240 +64,308 @@ class GovGAST1(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fidle: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) loadinc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tltr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ltrate: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGAST2.py b/pycgmes/resources/GovGAST2.py index 2cf2e4a6..c549777e 100644 --- a/pycgmes/resources/GovGAST2.py +++ b/pycgmes/resources/GovGAST2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGAST2(TurbineGovernorDynamics): """ Gas turbine. @@ -59,226 +58,290 @@ class GovGAST2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) w: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) x: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) y: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) z: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) etd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tcd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) trate: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ecr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) c: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) af1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) af2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGAST3.py b/pycgmes/resources/GovGAST3.py index 63bff322..16b36105 100644 --- a/pycgmes/resources/GovGAST3.py +++ b/pycgmes/resources/GovGAST3.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGAST3(TurbineGovernorDynamics): """ Generic turbogas with acceleration and temperature controller. @@ -46,149 +45,191 @@ class GovGAST3(TurbineGovernorDynamics): bp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rcmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rcmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ky: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ty: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tac: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kac: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bca: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kca: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tsi: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ksi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ttc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tfen: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mxef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mnef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGAST4.py b/pycgmes/resources/GovGAST4.py index 82601645..f07db5f5 100644 --- a/pycgmes/resources/GovGAST4.py +++ b/pycgmes/resources/GovGAST4.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGAST4(TurbineGovernorDynamics): """ Generic turbogas. @@ -36,79 +35,101 @@ class GovGAST4(TurbineGovernorDynamics): bp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ty: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tcm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ktm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rymx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rymn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mxef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mnef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovGASTWD.py b/pycgmes/resources/GovGASTWD.py index 5776c00a..418123c1 100644 --- a/pycgmes/resources/GovGASTWD.py +++ b/pycgmes/resources/GovGASTWD.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovGASTWD(TurbineGovernorDynamics): """ Woodwardâ„¢ gas turbine governor. [Footnote: Woodward gas turbines are an example of suitable products available @@ -61,233 +60,299 @@ class GovGASTWD(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdroop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) etd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tcd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) trate: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ecr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) c: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) af1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) af2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydro1.py b/pycgmes/resources/GovHydro1.py index 2679093c..98bafe84 100644 --- a/pycgmes/resources/GovHydro1.py +++ b/pycgmes/resources/GovHydro1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydro1(TurbineGovernorDynamics): """ Basic hydro turbine governor. @@ -39,100 +38,128 @@ class GovHydro1(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rperm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rtemp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) at: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hdam: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydro2.py b/pycgmes/resources/GovHydro2.py index 0ee1e3bd..c881f160 100644 --- a/pycgmes/resources/GovHydro2.py +++ b/pycgmes/resources/GovHydro2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydro2(TurbineGovernorDynamics): """ IEEE hydro turbine governor with straightforward penstock configuration and hydraulic-dashpot governor. @@ -54,205 +53,263 @@ class GovHydro2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rperm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rtemp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydro3.py b/pycgmes/resources/GovHydro3.py index 7dd77c28..adeab46f 100644 --- a/pycgmes/resources/GovHydro3.py +++ b/pycgmes/resources/GovHydro3.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydro3(TurbineGovernorDynamics): """ Modified IEEE hydro governor-turbine. This model differs from that defined in the IEEE modelling guideline paper in @@ -63,254 +62,326 @@ class GovHydro3(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) governorControl: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rgate: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) relec: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) at: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydro4.py b/pycgmes/resources/GovHydro4.py index 361b4363..c9038c0b 100644 --- a/pycgmes/resources/GovHydro4.py +++ b/pycgmes/resources/GovHydro4.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydro4(TurbineGovernorDynamics): """ Hydro turbine and governor. Represents plants with straight-forward penstock configurations and hydraulic governors @@ -79,275 +78,353 @@ class GovHydro4(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rperm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rtemp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) at: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hdam: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tblade: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) model: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydro4ModelKind.py b/pycgmes/resources/GovHydro4ModelKind.py index 7b017bb9..6881d752 100644 --- a/pycgmes/resources/GovHydro4ModelKind.py +++ b/pycgmes/resources/GovHydro4ModelKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class GovHydro4ModelKind(Base): """ Possible types of GovHydro4 models. diff --git a/pycgmes/resources/GovHydroDD.py b/pycgmes/resources/GovHydroDD.py index 2a2df93c..e687150a 100644 --- a/pycgmes/resources/GovHydroDD.py +++ b/pycgmes/resources/GovHydroDD.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroDD(TurbineGovernorDynamics): """ Double derivative hydro governor and turbine. @@ -62,247 +61,317 @@ class GovHydroDD(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tturb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroFrancis.py b/pycgmes/resources/GovHydroFrancis.py index 3bc08241..e2fbee90 100644 --- a/pycgmes/resources/GovHydroFrancis.py +++ b/pycgmes/resources/GovHydroFrancis.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroFrancis(TurbineGovernorDynamics): """ Detailed hydro unit - Francis model. This model can be used to represent three types of governors. A schematic of @@ -58,191 +57,245 @@ class GovHydroFrancis(TurbineGovernorDynamics): am: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) av0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) av1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) etamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) governorControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qc0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twnc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twng: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tx: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) va: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) valvmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) valvmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) waterTunnelSurgeChamberSimulation: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) zsfc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroIEEE0.py b/pycgmes/resources/GovHydroIEEE0.py index f971feb7..dd158f87 100644 --- a/pycgmes/resources/GovHydroIEEE0.py +++ b/pycgmes/resources/GovHydroIEEE0.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroIEEE0(TurbineGovernorDynamics): """ IEEE simplified hydro governor-turbine model. Used for mechanical-hydraulic and electro-hydraulic turbine @@ -36,58 +35,74 @@ class GovHydroIEEE0(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroIEEE2.py b/pycgmes/resources/GovHydroIEEE2.py index 1007b9f0..5508669b 100644 --- a/pycgmes/resources/GovHydroIEEE2.py +++ b/pycgmes/resources/GovHydroIEEE2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroIEEE2(TurbineGovernorDynamics): """ IEEE hydro turbine governor model represents plants with straightforward penstock configurations and hydraulic- @@ -53,184 +52,236 @@ class GovHydroIEEE2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rperm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rtemp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroPID.py b/pycgmes/resources/GovHydroPID.py index 7882b9b3..67fb4d37 100644 --- a/pycgmes/resources/GovHydroPID.py +++ b/pycgmes/resources/GovHydroPID.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroPID(TurbineGovernorDynamics): """ PID governor and turbine. @@ -60,233 +59,299 @@ class GovHydroPID(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tturb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) aturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroPID2.py b/pycgmes/resources/GovHydroPID2.py index 5fc1eafd..8d062322 100644 --- a/pycgmes/resources/GovHydroPID2.py +++ b/pycgmes/resources/GovHydroPID2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroPID2(TurbineGovernorDynamics): """ Hydro turbine and governor. Represents plants with straightforward penstock configurations and "three term" electro- @@ -50,156 +49,200 @@ class GovHydroPID2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) treg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rperm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) g0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) g1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) g2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) atw: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) feedbackSignal: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroPelton.py b/pycgmes/resources/GovHydroPelton.py index b769987a..90760872 100644 --- a/pycgmes/resources/GovHydroPelton.py +++ b/pycgmes/resources/GovHydroPelton.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroPelton(TurbineGovernorDynamics): """ Detailed hydro unit - Pelton model. This model can be used to represent the dynamic related to water tunnel and @@ -61,198 +60,254 @@ class GovHydroPelton(TurbineGovernorDynamics): av0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) av1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qc0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) simplifiedPelton: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) staticCompensating: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twnc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twng: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tx: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) va: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) valvmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) valvmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vav: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) waterTunnelSurgeChamberSimulation: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) zsfc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroR.py b/pycgmes/resources/GovHydroR.py index 2bd4fb94..d2d37875 100644 --- a/pycgmes/resources/GovHydroR.py +++ b/pycgmes/resources/GovHydroR.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroR(TurbineGovernorDynamics): """ Fourth order lead-lag governor and hydro turbine. @@ -69,296 +68,380 @@ class GovHydroR(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) at: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qnl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroWEH.py b/pycgmes/resources/GovHydroWEH.py index 0ba023e6..ecae1446 100644 --- a/pycgmes/resources/GovHydroWEH.py +++ b/pycgmes/resources/GovHydroWEH.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroWEH(TurbineGovernorDynamics): """ WoodwardTM electric hydro governor. [Footnote: Woodward electric hydro governors are an example of suitable @@ -111,359 +110,461 @@ class GovHydroWEH(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rpg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpe: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gtmxop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gtmxcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dturb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dicn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) feedbackSignal: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fl1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fl2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fl3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fl4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fl5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fp10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmss10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovHydroWPID.py b/pycgmes/resources/GovHydroWPID.py index 6e4adbef..e387a956 100644 --- a/pycgmes/resources/GovHydroWPID.py +++ b/pycgmes/resources/GovHydroWPID.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovHydroWPID(TurbineGovernorDynamics): """ WoodwardTM PID hydro governor. [Footnote: Woodward PID hydro governors are an example of suitable products available @@ -49,156 +48,200 @@ class GovHydroWPID(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) treg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) reg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) velmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gatmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gatmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteam0.py b/pycgmes/resources/GovSteam0.py index 2e1636d7..ce2d5179 100644 --- a/pycgmes/resources/GovSteam0.py +++ b/pycgmes/resources/GovSteam0.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteam0(TurbineGovernorDynamics): """ A simplified steam turbine governor. @@ -33,58 +32,74 @@ class GovSteam0(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteam1.py b/pycgmes/resources/GovSteam1.py index 047adc28..2b69d55c 100644 --- a/pycgmes/resources/GovSteam1.py +++ b/pycgmes/resources/GovSteam1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteam1(TurbineGovernorDynamics): """ Steam turbine governor, based on the GovSteamIEEE1 (with optional deadband and nonlinear valve gain added). @@ -67,275 +66,353 @@ class GovSteam1(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) sdb1: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) sdb2: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) valve: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteam2.py b/pycgmes/resources/GovSteam2.py index aa61583c..a278629f 100644 --- a/pycgmes/resources/GovSteam2.py +++ b/pycgmes/resources/GovSteam2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteam2(TurbineGovernorDynamics): """ Simplified governor. @@ -33,58 +32,74 @@ class GovSteam2(TurbineGovernorDynamics): k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dbf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mxef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mnef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamBB.py b/pycgmes/resources/GovSteamBB.py index 7159ea96..2a21c7ae 100644 --- a/pycgmes/resources/GovSteamBB.py +++ b/pycgmes/resources/GovSteamBB.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamBB(TurbineGovernorDynamics): """ European governor model. @@ -43,121 +42,155 @@ class GovSteamBB(TurbineGovernorDynamics): fcut: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kls: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kg: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tn: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) peflag: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamCC.py b/pycgmes/resources/GovSteamCC.py index d75d50e8..69135755 100644 --- a/pycgmes/resources/GovSteamCC.py +++ b/pycgmes/resources/GovSteamCC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .CrossCompoundTurbineGovernorDynamics import CrossCompoundTurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamCC(CrossCompoundTurbineGovernorDynamics): """ Cross compound turbine governor. Unlike tandem compound units, cross compound units are not on the same shaft. @@ -42,121 +41,155 @@ class GovSteamCC(CrossCompoundTurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmaxhp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rhp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1hp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3hp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4hp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5hp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fhp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dhp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmaxlp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rlp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1lp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3lp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4lp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5lp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) flp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dlp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamEU.py b/pycgmes/resources/GovSteamEU.py index 11cc0557..11afe8c2 100644 --- a/pycgmes/resources/GovSteamEU.py +++ b/pycgmes/resources/GovSteamEU.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamEU(TurbineGovernorDynamics): """ Simplified boiler and steam turbine with PID governor. @@ -60,247 +59,317 @@ class GovSteamEU(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ke: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tip: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tfp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kfcor: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wfmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ten: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) komegacor: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wwmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wwmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wmax1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) wmax2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tvhp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cho: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) chc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hhpmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tvip: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cio: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cic: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) simx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) trh: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tlp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) prhmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) khp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) klp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamFV2.py b/pycgmes/resources/GovSteamFV2.py index e86c26ee..40ac2679 100644 --- a/pycgmes/resources/GovSteamFV2.py +++ b/pycgmes/resources/GovSteamFV2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamFV2(TurbineGovernorDynamics): """ Steam turbine governor with reheat time constants and modelling of the effects of fast valve closing to reduce @@ -38,86 +37,110 @@ class GovSteamFV2(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamFV3.py b/pycgmes/resources/GovSteamFV3.py index c8cb7001..791925e1 100644 --- a/pycgmes/resources/GovSteamFV3.py +++ b/pycgmes/resources/GovSteamFV3.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamFV3(TurbineGovernorDynamics): """ Simplified GovSteamIEEE1 steam turbine governor with Prmax limit and fast valving. @@ -57,219 +56,281 @@ class GovSteamFV3(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) prmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) gv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pgv6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamFV4.py b/pycgmes/resources/GovSteamFV4.py index 20d6ae5a..cc6f736c 100644 --- a/pycgmes/resources/GovSteamFV4.py +++ b/pycgmes/resources/GovSteamFV4.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamFV4(TurbineGovernorDynamics): """ Detailed electro-hydraulic governor for steam unit. @@ -77,359 +76,461 @@ class GovSteamFV4(TurbineGovernorDynamics): kf1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lps: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lpi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mxef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mnef: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) crmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) crmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kit: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rvgmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rvgmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) svmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) svmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) srmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) srmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rsmimx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rsmimn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kmp1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kmp2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) srsmp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ty: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) yhpmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) yhpmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tam: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tcm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ympmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ympmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) y: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) trh: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tmp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) khp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pr1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pr2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) psmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kic: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cpsmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) cpsmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) krc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ksh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamIEEE1.py b/pycgmes/resources/GovSteamIEEE1.py index a3a643cb..379b6ee5 100644 --- a/pycgmes/resources/GovSteamIEEE1.py +++ b/pycgmes/resources/GovSteamIEEE1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamIEEE1(TurbineGovernorDynamics): """ IEEE steam turbine governor model. Reference: IEEE Transactions on Power Apparatus and Systems, November/December @@ -47,149 +46,191 @@ class GovSteamIEEE1(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GovSteamSGO.py b/pycgmes/resources/GovSteamSGO.py index 3243527d..d268bb0f 100644 --- a/pycgmes/resources/GovSteamSGO.py +++ b/pycgmes/resources/GovSteamSGO.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class GovSteamSGO(TurbineGovernorDynamics): """ Simplified steam turbine governor. @@ -37,86 +36,110 @@ class GovSteamSGO(TurbineGovernorDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/GrossToNetActivePowerCurve.py b/pycgmes/resources/GrossToNetActivePowerCurve.py index 79bf95d4..e9ac0861 100644 --- a/pycgmes/resources/GrossToNetActivePowerCurve.py +++ b/pycgmes/resources/GrossToNetActivePowerCurve.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Curve import Curve -@dataclass(config=DataclassConfig) +@dataclass class GrossToNetActivePowerCurve(Curve): """ Relationship between the generating unit's gross active power output on the X-axis (measured at the terminals of the @@ -31,9 +30,11 @@ class GrossToNetActivePowerCurve(Curve): GeneratingUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Ground.py b/pycgmes/resources/Ground.py index 78d2ebf7..e50295d8 100644 --- a/pycgmes/resources/Ground.py +++ b/pycgmes/resources/Ground.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class Ground(ConductingEquipment): """ A point where the system is grounded used for connecting conducting equipment to ground. The power system model can diff --git a/pycgmes/resources/GroundDisconnector.py b/pycgmes/resources/GroundDisconnector.py index 578faf02..cc87e84b 100644 --- a/pycgmes/resources/GroundDisconnector.py +++ b/pycgmes/resources/GroundDisconnector.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class GroundDisconnector(Switch): """ A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from diff --git a/pycgmes/resources/GroundingImpedance.py b/pycgmes/resources/GroundingImpedance.py index dba20f02..e01919ff 100644 --- a/pycgmes/resources/GroundingImpedance.py +++ b/pycgmes/resources/GroundingImpedance.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EarthFaultCompensator import EarthFaultCompensator -@dataclass(config=DataclassConfig) +@dataclass class GroundingImpedance(EarthFaultCompensator): """ A fixed impedance device used for grounding. @@ -26,9 +25,11 @@ class GroundingImpedance(EarthFaultCompensator): x: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/HVDCDynamics.py b/pycgmes/resources/HVDCDynamics.py index dd083e90..fdf37f6f 100644 --- a/pycgmes/resources/HVDCDynamics.py +++ b/pycgmes/resources/HVDCDynamics.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class HVDCDynamics(DynamicsFunctionBlock): """ HVDC whose behaviour is described by reference to a standard model or by definition of a user-defined model. diff --git a/pycgmes/resources/HydroEnergyConversionKind.py b/pycgmes/resources/HydroEnergyConversionKind.py index 39da9db7..53da0ea1 100644 --- a/pycgmes/resources/HydroEnergyConversionKind.py +++ b/pycgmes/resources/HydroEnergyConversionKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class HydroEnergyConversionKind(Base): """ Specifies the capability of the hydro generating unit to convert energy as a generator or pump. diff --git a/pycgmes/resources/HydroGeneratingUnit.py b/pycgmes/resources/HydroGeneratingUnit.py index 665cc0a4..56fb1279 100644 --- a/pycgmes/resources/HydroGeneratingUnit.py +++ b/pycgmes/resources/HydroGeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .GeneratingUnit import GeneratingUnit -@dataclass(config=DataclassConfig) +@dataclass class HydroGeneratingUnit(GeneratingUnit): """ A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan). @@ -30,30 +29,38 @@ class HydroGeneratingUnit(GeneratingUnit): energyConversionCapability: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) dropHeight: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) turbineType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) HydroPowerPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/HydroPlantStorageKind.py b/pycgmes/resources/HydroPlantStorageKind.py index 9a75be5a..701aff47 100644 --- a/pycgmes/resources/HydroPlantStorageKind.py +++ b/pycgmes/resources/HydroPlantStorageKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class HydroPlantStorageKind(Base): """ The type of hydro power plant. diff --git a/pycgmes/resources/HydroPowerPlant.py b/pycgmes/resources/HydroPowerPlant.py index 48f996b4..210c408c 100644 --- a/pycgmes/resources/HydroPowerPlant.py +++ b/pycgmes/resources/HydroPowerPlant.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class HydroPowerPlant(PowerSystemResource): """ A hydro power station which can generate or pump. When generating, the generator turbines receive water from an @@ -29,19 +28,21 @@ class HydroPowerPlant(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # HydroGeneratingUnits : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # HydroGeneratingUnits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 hydroPlantStorageType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # HydroPumps : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # HydroPumps : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/HydroPump.py b/pycgmes/resources/HydroPump.py index 7e0ee3fd..36d1d5ca 100644 --- a/pycgmes/resources/HydroPump.py +++ b/pycgmes/resources/HydroPump.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class HydroPump(Equipment): """ A synchronous motor-driven pump, typically associated with a pumped storage plant. @@ -30,16 +29,20 @@ class HydroPump(Equipment): HydroPowerPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) RotatingMachine: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/HydroTurbineKind.py b/pycgmes/resources/HydroTurbineKind.py index cd75415e..ede14ce1 100644 --- a/pycgmes/resources/HydroTurbineKind.py +++ b/pycgmes/resources/HydroTurbineKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class HydroTurbineKind(Base): """ Type of turbine. diff --git a/pycgmes/resources/IOPoint.py b/pycgmes/resources/IOPoint.py index fca93a3b..8d0a70ba 100644 --- a/pycgmes/resources/IOPoint.py +++ b/pycgmes/resources/IOPoint.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class IOPoint(IdentifiedObject): """ The class describe a measurement or control value. The purpose is to enable having attributes and associations diff --git a/pycgmes/resources/IdentifiedObject.py b/pycgmes/resources/IdentifiedObject.py index 7f190c69..90261f52 100644 --- a/pycgmes/resources/IdentifiedObject.py +++ b/pycgmes/resources/IdentifiedObject.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class IdentifiedObject(Base): """ This is a root class to provide common identification for all classes needing identification and naming attributes. @@ -38,67 +37,77 @@ class IdentifiedObject(Base): description: str = Field( default="", - in_profiles=[ - Profile.TP, - Profile.DL, - Profile.EQBD, - Profile.EQ, - Profile.DY, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + Profile.DL, + Profile.EQBD, + Profile.EQ, + Profile.DY, + Profile.OP, + ] + }, ) energyIdentCodeEic: str = Field( default="", - in_profiles=[ - Profile.TP, - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + Profile.EQBD, + Profile.EQ, + ] + }, ) mRID: str = Field( default="", - in_profiles=[ - Profile.TP, - Profile.GL, - Profile.DL, - Profile.EQBD, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - Profile.DY, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + Profile.GL, + Profile.DL, + Profile.EQBD, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + Profile.DY, + Profile.OP, + ] + }, ) name: str = Field( default="", - in_profiles=[ - Profile.TP, - Profile.GL, - Profile.DL, - Profile.EQBD, - Profile.EQ, - Profile.SV, - Profile.DY, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + Profile.GL, + Profile.DL, + Profile.EQBD, + Profile.EQ, + Profile.SV, + Profile.DY, + Profile.OP, + ] + }, ) shortName: str = Field( default="", - in_profiles=[ - Profile.TP, - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DiagramObjects : list = Field(default_factory=list, in_profiles = [Profile.DL, ]) + # Type M:0..n in CIM + # DiagramObjects : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DL, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/IfdBaseKind.py b/pycgmes/resources/IfdBaseKind.py index c85ecca4..1666088c 100644 --- a/pycgmes/resources/IfdBaseKind.py +++ b/pycgmes/resources/IfdBaseKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class IfdBaseKind(Base): """ Excitation base system mode. diff --git a/pycgmes/resources/Inductance.py b/pycgmes/resources/Inductance.py index c73ef9b8..3ce1a3e2 100644 --- a/pycgmes/resources/Inductance.py +++ b/pycgmes/resources/Inductance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Inductance(Base): """ Inductive part of reactance (imaginary part of impedance), at rated frequency. @@ -29,23 +28,29 @@ class Inductance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/InputSignalKind.py b/pycgmes/resources/InputSignalKind.py index db9decf4..9201ee64 100644 --- a/pycgmes/resources/InputSignalKind.py +++ b/pycgmes/resources/InputSignalKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class InputSignalKind(Base): """ Types of input signals. In dynamics modelling, commonly represented by the j parameter. diff --git a/pycgmes/resources/Integer.py b/pycgmes/resources/Integer.py index 50fb64e9..cfa14d0d 100644 --- a/pycgmes/resources/Integer.py +++ b/pycgmes/resources/Integer.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Integer(Base): """ An integer number. The range is unspecified and not limited. diff --git a/pycgmes/resources/Jumper.py b/pycgmes/resources/Jumper.py index cd84c8cd..764ea391 100644 --- a/pycgmes/resources/Jumper.py +++ b/pycgmes/resources/Jumper.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class Jumper(Switch): """ A short section of conductor with negligible impedance which can be manually removed and replaced if the circuit is diff --git a/pycgmes/resources/Junction.py b/pycgmes/resources/Junction.py index 0c89a99a..5265ed72 100644 --- a/pycgmes/resources/Junction.py +++ b/pycgmes/resources/Junction.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Connector import Connector -@dataclass(config=DataclassConfig) +@dataclass class Junction(Connector): """ A point where one or more conducting equipments are connected with zero resistance. diff --git a/pycgmes/resources/Length.py b/pycgmes/resources/Length.py index 6401500e..be36508a 100644 --- a/pycgmes/resources/Length.py +++ b/pycgmes/resources/Length.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Length(Base): """ Unit of length. It shall be a positive value or zero. @@ -29,29 +28,35 @@ class Length(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Limit.py b/pycgmes/resources/Limit.py index 1c94df0f..c3b601ef 100644 --- a/pycgmes/resources/Limit.py +++ b/pycgmes/resources/Limit.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Limit(IdentifiedObject): """ Specifies one limit value for a Measurement. A Measurement typically has several limits that are kept together by diff --git a/pycgmes/resources/LimitKind.py b/pycgmes/resources/LimitKind.py index c9bff1dc..4108694d 100644 --- a/pycgmes/resources/LimitKind.py +++ b/pycgmes/resources/LimitKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class LimitKind(Base): """ Limit kinds. diff --git a/pycgmes/resources/LimitSet.py b/pycgmes/resources/LimitSet.py index fb7370f8..d9c43bea 100644 --- a/pycgmes/resources/LimitSet.py +++ b/pycgmes/resources/LimitSet.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LimitSet(IdentifiedObject): """ Specifies a set of Limits that are associated with a Measurement. A Measurement may have several LimitSets @@ -30,9 +29,11 @@ class LimitSet(IdentifiedObject): isPercentageLimits: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Line.py b/pycgmes/resources/Line.py index 68e9ddd8..7d65a800 100644 --- a/pycgmes/resources/Line.py +++ b/pycgmes/resources/Line.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquipmentContainer import EquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class Line(EquipmentContainer): """ Contains equipment beyond a substation belonging to a power transmission line. @@ -27,10 +26,12 @@ class Line(EquipmentContainer): Region: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LinearShuntCompensator.py b/pycgmes/resources/LinearShuntCompensator.py index fd1f206b..0b3d5f65 100644 --- a/pycgmes/resources/LinearShuntCompensator.py +++ b/pycgmes/resources/LinearShuntCompensator.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ShuntCompensator import ShuntCompensator -@dataclass(config=DataclassConfig) +@dataclass class LinearShuntCompensator(ShuntCompensator): """ A linear shunt compensator has banks or sections with equal admittance values. @@ -29,30 +28,38 @@ class LinearShuntCompensator(ShuntCompensator): bPerSection: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) gPerSection: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) b0PerSection: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) g0PerSection: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadAggregate.py b/pycgmes/resources/LoadAggregate.py index cf215a29..79f31ff0 100644 --- a/pycgmes/resources/LoadAggregate.py +++ b/pycgmes/resources/LoadAggregate.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadDynamics import LoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class LoadAggregate(LoadDynamics): """ Aggregate loads are used to represent all or part of the real and reactive load from one or more loads in the static @@ -31,12 +30,12 @@ class LoadAggregate(LoadDynamics): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # LoadMotor : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # LoadMotor : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # LoadStatic : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # LoadStatic : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/LoadArea.py b/pycgmes/resources/LoadArea.py index ec9764d6..4afadf41 100644 --- a/pycgmes/resources/LoadArea.py +++ b/pycgmes/resources/LoadArea.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyArea import EnergyArea -@dataclass(config=DataclassConfig) +@dataclass class LoadArea(EnergyArea): """ The class is the root or first level in a hierarchical structure for grouping of loads for the purpose of load flow @@ -25,8 +24,8 @@ class LoadArea(EnergyArea): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # SubLoadAreas : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # SubLoadAreas : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/LoadBreakSwitch.py b/pycgmes/resources/LoadBreakSwitch.py index 9f9bff5c..808cb5e5 100644 --- a/pycgmes/resources/LoadBreakSwitch.py +++ b/pycgmes/resources/LoadBreakSwitch.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ProtectedSwitch import ProtectedSwitch -@dataclass(config=DataclassConfig) +@dataclass class LoadBreakSwitch(ProtectedSwitch): """ A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. diff --git a/pycgmes/resources/LoadComposite.py b/pycgmes/resources/LoadComposite.py index 36ae218b..732dcc79 100644 --- a/pycgmes/resources/LoadComposite.py +++ b/pycgmes/resources/LoadComposite.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadDynamics import LoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class LoadComposite(LoadDynamics): """ Combined static load and induction motor load effects. The dynamics of the motor are simplified by linearizing the @@ -38,79 +37,101 @@ class LoadComposite(LoadDynamics): epvs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) epfs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eqvs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eqfs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) epvd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) epfd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eqvd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eqfd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lfac: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pfrac: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadDynamics.py b/pycgmes/resources/LoadDynamics.py index 533a6fa9..ab5d8165 100644 --- a/pycgmes/resources/LoadDynamics.py +++ b/pycgmes/resources/LoadDynamics.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LoadDynamics(IdentifiedObject): """ Load whose behaviour is described by reference to a standard model or by definition of a user-defined model. A @@ -27,8 +26,8 @@ class LoadDynamics(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # EnergyConsumer : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # EnergyConsumer : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/LoadGenericNonLinear.py b/pycgmes/resources/LoadGenericNonLinear.py index de6f6f73..b36d0af0 100644 --- a/pycgmes/resources/LoadGenericNonLinear.py +++ b/pycgmes/resources/LoadGenericNonLinear.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadDynamics import LoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class LoadGenericNonLinear(LoadDynamics): """ Generic non-linear dynamic (GNLD) load. This model can be used in mid-term and long-term voltage stability @@ -35,51 +34,65 @@ class LoadGenericNonLinear(LoadDynamics): genericNonLinearLoadModelType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ls: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadGroup.py b/pycgmes/resources/LoadGroup.py index 49314284..e6dd538b 100644 --- a/pycgmes/resources/LoadGroup.py +++ b/pycgmes/resources/LoadGroup.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LoadGroup(IdentifiedObject): """ The class is the third level in a hierarchical structure for grouping of loads for the purpose of load flow load @@ -28,9 +27,11 @@ class LoadGroup(IdentifiedObject): SubLoadArea: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadMotor.py b/pycgmes/resources/LoadMotor.py index 656692ec..c8880cc4 100644 --- a/pycgmes/resources/LoadMotor.py +++ b/pycgmes/resources/LoadMotor.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LoadMotor(IdentifiedObject): """ Aggregate induction motor load. This model is used to represent a fraction of an ordinary load as "induction motor @@ -55,100 +54,128 @@ class LoadMotor(IdentifiedObject): LoadAggregate: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pfrac: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lfac: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ls: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ra: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tppo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) h: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tbkr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadResponseCharacteristic.py b/pycgmes/resources/LoadResponseCharacteristic.py index 398abc09..38f713f4 100644 --- a/pycgmes/resources/LoadResponseCharacteristic.py +++ b/pycgmes/resources/LoadResponseCharacteristic.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LoadResponseCharacteristic(IdentifiedObject): """ Models the characteristic response of the load demand due to changes in system conditions such as voltage and @@ -55,84 +54,106 @@ class LoadResponseCharacteristic(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # EnergyConsumer : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # EnergyConsumer : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) exponentModel: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pConstantCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pConstantImpedance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pConstantPower: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pFrequencyExponent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) pVoltageExponent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qConstantCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qConstantImpedance: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qConstantPower: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qFrequencyExponent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qVoltageExponent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadStatic.py b/pycgmes/resources/LoadStatic.py index 85ea5150..07ad4c7a 100644 --- a/pycgmes/resources/LoadStatic.py +++ b/pycgmes/resources/LoadStatic.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class LoadStatic(IdentifiedObject): """ General static load. This model represents the sensitivity of the real and reactive power consumed by the load to @@ -47,128 +46,164 @@ class LoadStatic(IdentifiedObject): LoadAggregate: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) staticLoadModelType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ep1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ep2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ep3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kq1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kq2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kq3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kq4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eq1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eq2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) eq3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kqf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/LoadUserDefined.py b/pycgmes/resources/LoadUserDefined.py index 8e41bb63..3289b162 100644 --- a/pycgmes/resources/LoadUserDefined.py +++ b/pycgmes/resources/LoadUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadDynamics import LoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class LoadUserDefined(LoadDynamics): """ Load whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class LoadUserDefined(LoadDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Location.py b/pycgmes/resources/Location.py index 12b574f6..ede77d4a 100644 --- a/pycgmes/resources/Location.py +++ b/pycgmes/resources/Location.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Location(IdentifiedObject): """ The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in @@ -32,28 +31,34 @@ class Location(IdentifiedObject): CoordinateSystem: Optional[str] = Field( default=None, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) mainAddress: float = Field( default=0.0, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) PowerSystemResources: Optional[str] = Field( default=None, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # PositionPoints : list = Field(default_factory=list, in_profiles = [Profile.GL, ]) + # Type M:0..n in CIM + # PositionPoints : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.GL, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Measurement.py b/pycgmes/resources/Measurement.py index c724a060..0cf20817 100644 --- a/pycgmes/resources/Measurement.py +++ b/pycgmes/resources/Measurement.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Measurement(IdentifiedObject): """ A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment @@ -53,44 +52,56 @@ class Measurement(IdentifiedObject): Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) measurementType: str = Field( default="", - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) phases: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) unitMultiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) unitSymbol: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) PowerSystemResource: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MeasurementValue.py b/pycgmes/resources/MeasurementValue.py index e0a7e457..ec4917d8 100644 --- a/pycgmes/resources/MeasurementValue.py +++ b/pycgmes/resources/MeasurementValue.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IOPoint import IOPoint -@dataclass(config=DataclassConfig) +@dataclass class MeasurementValue(IOPoint): """ The current state for a measurement. A state value is an instance of a measurement from a specific source. @@ -35,27 +34,33 @@ class MeasurementValue(IOPoint): timeStamp: str = Field( default="", - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) sensorAccuracy: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # MeasurementValueQuality : Optional[str] = Field(default=None, in_profiles = [Profile.OP, ]) + # Type M:0..1 in CIM + # MeasurementValueQuality : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 MeasurementValueSource: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MeasurementValueQuality.py b/pycgmes/resources/MeasurementValueQuality.py index dd696530..6869331c 100644 --- a/pycgmes/resources/MeasurementValueQuality.py +++ b/pycgmes/resources/MeasurementValueQuality.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Quality61850 import Quality61850 -@dataclass(config=DataclassConfig) +@dataclass class MeasurementValueQuality(Quality61850): """ Measurement quality flags. Bits 0-10 are defined for substation automation in IEC 61850-7-3. Bits 11-15 are reserved @@ -28,9 +27,11 @@ class MeasurementValueQuality(Quality61850): MeasurementValue: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MeasurementValueSource.py b/pycgmes/resources/MeasurementValueSource.py index 8754be66..6d93d36c 100644 --- a/pycgmes/resources/MeasurementValueSource.py +++ b/pycgmes/resources/MeasurementValueSource.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class MeasurementValueSource(IdentifiedObject): """ MeasurementValueSource describes the alternative sources updating a MeasurementValue. User conventions for how to @@ -25,8 +24,8 @@ class MeasurementValueSource(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # MeasurementValues : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # MeasurementValues : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/MechLoad1.py b/pycgmes/resources/MechLoad1.py index f852cc5a..ab7edd41 100644 --- a/pycgmes/resources/MechLoad1.py +++ b/pycgmes/resources/MechLoad1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MechanicalLoadDynamics import MechanicalLoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class MechLoad1(MechanicalLoadDynamics): """ Mechanical load model type 1. @@ -29,30 +28,38 @@ class MechLoad1(MechanicalLoadDynamics): a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) e: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MechanicalLoadDynamics.py b/pycgmes/resources/MechanicalLoadDynamics.py index 8ff4b108..a8c796da 100644 --- a/pycgmes/resources/MechanicalLoadDynamics.py +++ b/pycgmes/resources/MechanicalLoadDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class MechanicalLoadDynamics(DynamicsFunctionBlock): """ Mechanical load function block whose behaviour is described by reference to a standard model or by definition of a @@ -33,16 +32,20 @@ class MechanicalLoadDynamics(DynamicsFunctionBlock): SynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) AsynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MechanicalLoadUserDefined.py b/pycgmes/resources/MechanicalLoadUserDefined.py index 25e05fea..f604ced1 100644 --- a/pycgmes/resources/MechanicalLoadUserDefined.py +++ b/pycgmes/resources/MechanicalLoadUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MechanicalLoadDynamics import MechanicalLoadDynamics -@dataclass(config=DataclassConfig) +@dataclass class MechanicalLoadUserDefined(MechanicalLoadDynamics): """ Mechanical load function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class MechanicalLoadUserDefined(MechanicalLoadDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Money.py b/pycgmes/resources/Money.py index fc87ac84..3f12a486 100644 --- a/pycgmes/resources/Money.py +++ b/pycgmes/resources/Money.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Money(Base): """ Amount of money. @@ -29,23 +28,29 @@ class Money(Base): unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/MonthDay.py b/pycgmes/resources/MonthDay.py index 9286d80c..feacfef6 100644 --- a/pycgmes/resources/MonthDay.py +++ b/pycgmes/resources/MonthDay.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class MonthDay(Base): """ MonthDay format as "--mm-dd", which conforms with XSD data type gMonthDay. diff --git a/pycgmes/resources/MutualCoupling.py b/pycgmes/resources/MutualCoupling.py index e48b0ff3..12cc1b0e 100644 --- a/pycgmes/resources/MutualCoupling.py +++ b/pycgmes/resources/MutualCoupling.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class MutualCoupling(IdentifiedObject): """ This class represents the zero sequence line mutual coupling. @@ -41,72 +40,92 @@ class MutualCoupling(IdentifiedObject): b0ch: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) distance11: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) distance12: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) distance21: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) distance22: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) g0ch: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) Second_Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) First_Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/NonConformLoad.py b/pycgmes/resources/NonConformLoad.py index e3378858..a01df6dc 100644 --- a/pycgmes/resources/NonConformLoad.py +++ b/pycgmes/resources/NonConformLoad.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConsumer import EnergyConsumer -@dataclass(config=DataclassConfig) +@dataclass class NonConformLoad(EnergyConsumer): """ NonConformLoad represents loads that do not follow a daily load change pattern and whose changes are not correlated @@ -28,9 +27,11 @@ class NonConformLoad(EnergyConsumer): LoadGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/NonConformLoadGroup.py b/pycgmes/resources/NonConformLoadGroup.py index 0f34afb0..48b500d6 100644 --- a/pycgmes/resources/NonConformLoadGroup.py +++ b/pycgmes/resources/NonConformLoadGroup.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .LoadGroup import LoadGroup -@dataclass(config=DataclassConfig) +@dataclass class NonConformLoadGroup(LoadGroup): """ Loads that do not follow a daily and seasonal load variation pattern. @@ -25,12 +24,12 @@ class NonConformLoadGroup(LoadGroup): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # EnergyConsumers : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # EnergyConsumers : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # NonConformLoadSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # NonConformLoadSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/NonConformLoadSchedule.py b/pycgmes/resources/NonConformLoadSchedule.py index 25175a67..b88cf87d 100644 --- a/pycgmes/resources/NonConformLoadSchedule.py +++ b/pycgmes/resources/NonConformLoadSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SeasonDayTypeSchedule import SeasonDayTypeSchedule -@dataclass(config=DataclassConfig) +@dataclass class NonConformLoadSchedule(SeasonDayTypeSchedule): """ An active power (Y1-axis) and reactive power (Y2-axis) schedule (curves) versus time (X-axis) for non-conforming @@ -28,9 +27,11 @@ class NonConformLoadSchedule(SeasonDayTypeSchedule): NonConformLoadGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/NonlinearShuntCompensator.py b/pycgmes/resources/NonlinearShuntCompensator.py index 38596026..1cc1da90 100644 --- a/pycgmes/resources/NonlinearShuntCompensator.py +++ b/pycgmes/resources/NonlinearShuntCompensator.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ShuntCompensator import ShuntCompensator -@dataclass(config=DataclassConfig) +@dataclass class NonlinearShuntCompensator(ShuntCompensator): """ A non linear shunt compensator has bank or section admittance values that differ. The attributes g, b, g0 and b0 of @@ -26,8 +25,8 @@ class NonlinearShuntCompensator(ShuntCompensator): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # NonlinearShuntCompensatorPoints : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # NonlinearShuntCompensatorPoints : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/NonlinearShuntCompensatorPoint.py b/pycgmes/resources/NonlinearShuntCompensatorPoint.py index cd5c1bd6..f640899b 100644 --- a/pycgmes/resources/NonlinearShuntCompensatorPoint.py +++ b/pycgmes/resources/NonlinearShuntCompensatorPoint.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class NonlinearShuntCompensatorPoint(Base): """ A non linear shunt compensator bank or section admittance value. The number of NonlinearShuntCompenstorPoint @@ -35,44 +34,56 @@ class NonlinearShuntCompensatorPoint(Base): NonlinearShuntCompensator: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) g: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) sectionNumber: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) b0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) g0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/NuclearGeneratingUnit.py b/pycgmes/resources/NuclearGeneratingUnit.py index 64a04f14..2315b258 100644 --- a/pycgmes/resources/NuclearGeneratingUnit.py +++ b/pycgmes/resources/NuclearGeneratingUnit.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .GeneratingUnit import GeneratingUnit -@dataclass(config=DataclassConfig) +@dataclass class NuclearGeneratingUnit(GeneratingUnit): """ A nuclear generating unit. diff --git a/pycgmes/resources/OperationalLimit.py b/pycgmes/resources/OperationalLimit.py index 934a56ba..98f88bd2 100644 --- a/pycgmes/resources/OperationalLimit.py +++ b/pycgmes/resources/OperationalLimit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class OperationalLimit(IdentifiedObject): """ A value and normal value associated with a specific kind of limit. The sub class value and normalValue attributes @@ -34,16 +33,20 @@ class OperationalLimit(IdentifiedObject): OperationalLimitSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) OperationalLimitType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OperationalLimitDirectionKind.py b/pycgmes/resources/OperationalLimitDirectionKind.py index c6d90c6b..8fa0ca67 100644 --- a/pycgmes/resources/OperationalLimitDirectionKind.py +++ b/pycgmes/resources/OperationalLimitDirectionKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class OperationalLimitDirectionKind(Base): """ The direction attribute describes the side of a limit that is a violation. diff --git a/pycgmes/resources/OperationalLimitSet.py b/pycgmes/resources/OperationalLimitSet.py index ed59c5e1..b55b515a 100644 --- a/pycgmes/resources/OperationalLimitSet.py +++ b/pycgmes/resources/OperationalLimitSet.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class OperationalLimitSet(IdentifiedObject): """ A set of limits associated with equipment. Sets of limits might apply to a specific temperature, or season for @@ -32,21 +31,25 @@ class OperationalLimitSet(IdentifiedObject): Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) Equipment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # OperationalLimitValue : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # OperationalLimitValue : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/OperationalLimitType.py b/pycgmes/resources/OperationalLimitType.py index 4eefdf02..35ffdebb 100644 --- a/pycgmes/resources/OperationalLimitType.py +++ b/pycgmes/resources/OperationalLimitType.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class OperationalLimitType(IdentifiedObject): """ The operational meaning of a category of limits. @@ -36,35 +35,43 @@ class OperationalLimitType(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # OperationalLimit : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # OperationalLimit : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 acceptableDuration: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) direction: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) isInfiniteDuration: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) kind: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OrientationKind.py b/pycgmes/resources/OrientationKind.py index 631df8d1..78069cc5 100644 --- a/pycgmes/resources/OrientationKind.py +++ b/pycgmes/resources/OrientationKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class OrientationKind(Base): """ The orientation of the coordinate system with respect to top, left, and the coordinate number system. diff --git a/pycgmes/resources/OverexcLim2.py b/pycgmes/resources/OverexcLim2.py index 9931874f..a431b442 100644 --- a/pycgmes/resources/OverexcLim2.py +++ b/pycgmes/resources/OverexcLim2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OverexcitationLimiterDynamics import OverexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class OverexcLim2(OverexcitationLimiterDynamics): """ Different from LimIEEEOEL, LimOEL2 has a fixed pickup threshold and reduces the excitation set-point by means of a @@ -31,30 +30,38 @@ class OverexcLim2(OverexcitationLimiterDynamics): koi: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) voimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) voimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifdlim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OverexcLimIEEE.py b/pycgmes/resources/OverexcLimIEEE.py index 4a308f68..8d05929e 100644 --- a/pycgmes/resources/OverexcLimIEEE.py +++ b/pycgmes/resources/OverexcLimIEEE.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OverexcitationLimiterDynamics import OverexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class OverexcLimIEEE(OverexcitationLimiterDynamics): """ The over excitation limiter model is intended to represent the significant features of OELs necessary for some @@ -35,44 +34,56 @@ class OverexcLimIEEE(OverexcitationLimiterDynamics): itfpu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifdlim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hyst: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kcd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kramp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OverexcLimX1.py b/pycgmes/resources/OverexcLimX1.py index 6e2209b3..42c5bc2c 100644 --- a/pycgmes/resources/OverexcLimX1.py +++ b/pycgmes/resources/OverexcLimX1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OverexcitationLimiterDynamics import OverexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class OverexcLimX1(OverexcitationLimiterDynamics): """ Field voltage over excitation limiter. @@ -38,72 +37,92 @@ class OverexcLimX1(OverexcitationLimiterDynamics): efdrated: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efddes: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlow: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OverexcLimX2.py b/pycgmes/resources/OverexcLimX2.py index 979c42c1..c3413277 100644 --- a/pycgmes/resources/OverexcLimX2.py +++ b/pycgmes/resources/OverexcLimX2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OverexcitationLimiterDynamics import OverexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class OverexcLimX2(OverexcitationLimiterDynamics): """ Field voltage or current overexcitation limiter designed to protect the generator field of an AC machine with @@ -40,79 +39,101 @@ class OverexcLimX2(OverexcitationLimiterDynamics): m: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdrated: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efd3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efddes: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlow: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OverexcitationLimiterDynamics.py b/pycgmes/resources/OverexcitationLimiterDynamics.py index a0558ca4..41371bd0 100644 --- a/pycgmes/resources/OverexcitationLimiterDynamics.py +++ b/pycgmes/resources/OverexcitationLimiterDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class OverexcitationLimiterDynamics(DynamicsFunctionBlock): """ Overexcitation limiter function block whose behaviour is described by reference to a standard model or by definition @@ -28,9 +27,11 @@ class OverexcitationLimiterDynamics(DynamicsFunctionBlock): ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/OverexcitationLimiterUserDefined.py b/pycgmes/resources/OverexcitationLimiterUserDefined.py index 8002ed13..f139e399 100644 --- a/pycgmes/resources/OverexcitationLimiterUserDefined.py +++ b/pycgmes/resources/OverexcitationLimiterUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OverexcitationLimiterDynamics import OverexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class OverexcitationLimiterUserDefined(OverexcitationLimiterDynamics): """ Overexcitation limiter system function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class OverexcitationLimiterUserDefined(OverexcitationLimiterDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PFVArControllerType1Dynamics.py b/pycgmes/resources/PFVArControllerType1Dynamics.py index 417d7a40..75178e3d 100644 --- a/pycgmes/resources/PFVArControllerType1Dynamics.py +++ b/pycgmes/resources/PFVArControllerType1Dynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class PFVArControllerType1Dynamics(DynamicsFunctionBlock): """ Power factor or VAr controller type 1 function block whose behaviour is described by reference to a standard model @@ -30,19 +29,21 @@ class PFVArControllerType1Dynamics(DynamicsFunctionBlock): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # RemoteInputSignal : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # VoltageAdjusterDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # VoltageAdjusterDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PFVArControllerType1UserDefined.py b/pycgmes/resources/PFVArControllerType1UserDefined.py index 8e5eb4b6..d00d751d 100644 --- a/pycgmes/resources/PFVArControllerType1UserDefined.py +++ b/pycgmes/resources/PFVArControllerType1UserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType1Dynamics import PFVArControllerType1Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArControllerType1UserDefined(PFVArControllerType1Dynamics): """ Power factor or VAr controller type 1 function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class PFVArControllerType1UserDefined(PFVArControllerType1Dynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PFVArControllerType2Dynamics.py b/pycgmes/resources/PFVArControllerType2Dynamics.py index 674a059a..bea8be92 100644 --- a/pycgmes/resources/PFVArControllerType2Dynamics.py +++ b/pycgmes/resources/PFVArControllerType2Dynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class PFVArControllerType2Dynamics(DynamicsFunctionBlock): """ Power factor or VAr controller type 2 function block whose behaviour is described by reference to a standard model @@ -29,9 +28,11 @@ class PFVArControllerType2Dynamics(DynamicsFunctionBlock): ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PFVArControllerType2UserDefined.py b/pycgmes/resources/PFVArControllerType2UserDefined.py index 7236a9d3..efa5116c 100644 --- a/pycgmes/resources/PFVArControllerType2UserDefined.py +++ b/pycgmes/resources/PFVArControllerType2UserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType2Dynamics import PFVArControllerType2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArControllerType2UserDefined(PFVArControllerType2Dynamics): """ Power factor or VAr controller type 2 function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class PFVArControllerType2UserDefined(PFVArControllerType2Dynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PFVArType1IEEEPFController.py b/pycgmes/resources/PFVArType1IEEEPFController.py index 42d75a97..30b4e8a9 100644 --- a/pycgmes/resources/PFVArType1IEEEPFController.py +++ b/pycgmes/resources/PFVArType1IEEEPFController.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType1Dynamics import PFVArControllerType1Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArType1IEEEPFController(PFVArControllerType1Dynamics): """ IEEE PF controller type 1 which operates by moving the voltage reference directly. Reference: IEEE 421.5-2005, 11.2. @@ -35,58 +34,74 @@ class PFVArType1IEEEPFController(PFVArControllerType1Dynamics): ovex: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpfc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vitmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpfcbw: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vpfref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvtmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvtmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PFVArType1IEEEVArController.py b/pycgmes/resources/PFVArType1IEEEVArController.py index 7e9ce503..230776e8 100644 --- a/pycgmes/resources/PFVArType1IEEEVArController.py +++ b/pycgmes/resources/PFVArType1IEEEVArController.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType1Dynamics import PFVArControllerType1Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArType1IEEEVArController(PFVArControllerType1Dynamics): """ IEEE VAR controller type 1 which operates by moving the voltage reference directly. Reference: IEEE 421.5-2005, @@ -34,44 +33,56 @@ class PFVArType1IEEEVArController(PFVArControllerType1Dynamics): tvarc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvar: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvarcbw: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvarref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvtmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vvtmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PFVArType2Common1.py b/pycgmes/resources/PFVArType2Common1.py index df282703..c96a810d 100644 --- a/pycgmes/resources/PFVArType2Common1.py +++ b/pycgmes/resources/PFVArType2Common1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType2Dynamics import PFVArControllerType2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArType2Common1(PFVArControllerType2Dynamics): """ Power factor / reactive power regulator. This model represents the power factor or reactive power controller such as @@ -36,37 +35,47 @@ class PFVArType2Common1(PFVArControllerType2Dynamics): j: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PFVArType2IEEEPFController.py b/pycgmes/resources/PFVArType2IEEEPFController.py index a395257d..2f7627b4 100644 --- a/pycgmes/resources/PFVArType2IEEEPFController.py +++ b/pycgmes/resources/PFVArType2IEEEPFController.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType2Dynamics import PFVArControllerType2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArType2IEEEPFController(PFVArControllerType2Dynamics): """ IEEE PF controller type 2 which is a summing point type controller making up the outside loop of a two-loop system. @@ -36,51 +35,65 @@ class PFVArType2IEEEPFController(PFVArControllerType2Dynamics): pfref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vclmt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exlon: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PFVArType2IEEEVArController.py b/pycgmes/resources/PFVArType2IEEEVArController.py index 4aabfc06..c1c70f7c 100644 --- a/pycgmes/resources/PFVArType2IEEEVArController.py +++ b/pycgmes/resources/PFVArType2IEEEVArController.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PFVArControllerType2Dynamics import PFVArControllerType2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class PFVArType2IEEEVArController(PFVArControllerType2Dynamics): """ IEEE VAR controller type 2 which is a summing point type controller. It makes up the outside loop of a two-loop @@ -36,51 +35,65 @@ class PFVArType2IEEEVArController(PFVArControllerType2Dynamics): qref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vclmt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) exlon: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PU.py b/pycgmes/resources/PU.py index cd34701b..8d4aefab 100644 --- a/pycgmes/resources/PU.py +++ b/pycgmes/resources/PU.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class PU(Base): """ Per Unit - a positive or negative value referred to a defined base. Values typically range from -10 to +10. @@ -29,29 +28,35 @@ class PU(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.SSH, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.SSH, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - Profile.SSH, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.SSH, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PerCent.py b/pycgmes/resources/PerCent.py index 32bc100b..66bb0f0b 100644 --- a/pycgmes/resources/PerCent.py +++ b/pycgmes/resources/PerCent.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class PerCent(Base): """ Percentage on a defined base. For example, specify as 100 to indicate at the defined base. @@ -29,32 +28,38 @@ class PerCent(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + Profile.OP, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + Profile.OP, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PetersenCoil.py b/pycgmes/resources/PetersenCoil.py index e654a455..c3ea09d5 100644 --- a/pycgmes/resources/PetersenCoil.py +++ b/pycgmes/resources/PetersenCoil.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EarthFaultCompensator import EarthFaultCompensator -@dataclass(config=DataclassConfig) +@dataclass class PetersenCoil(EarthFaultCompensator): """ A variable impedance device normally used to offset line charging during single line faults in an ungrounded section @@ -39,51 +38,65 @@ class PetersenCoil(EarthFaultCompensator): mode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) nominalU: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) offsetCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) positionCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) xGroundMax: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) xGroundMin: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) xGroundNominal: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PetersenCoilModeKind.py b/pycgmes/resources/PetersenCoilModeKind.py index 7ea832ad..4a49664d 100644 --- a/pycgmes/resources/PetersenCoilModeKind.py +++ b/pycgmes/resources/PetersenCoilModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class PetersenCoilModeKind(Base): """ The mode of operation for a Petersen coil. diff --git a/pycgmes/resources/PhaseCode.py b/pycgmes/resources/PhaseCode.py index 5a863a90..e3f4de98 100644 --- a/pycgmes/resources/PhaseCode.py +++ b/pycgmes/resources/PhaseCode.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class PhaseCode(Base): """ An unordered enumeration of phase identifiers. Allows designation of phases for both transmission and distribution diff --git a/pycgmes/resources/PhaseTapChanger.py b/pycgmes/resources/PhaseTapChanger.py index c2098f77..ee01dd49 100644 --- a/pycgmes/resources/PhaseTapChanger.py +++ b/pycgmes/resources/PhaseTapChanger.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TapChanger import TapChanger -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChanger(TapChanger): """ A transformer phase shifting tap model that controls the phase angle difference across the power transformer and @@ -29,9 +28,11 @@ class PhaseTapChanger(TapChanger): TransformerEnd: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhaseTapChangerAsymmetrical.py b/pycgmes/resources/PhaseTapChangerAsymmetrical.py index 6d93643a..aae7c1d6 100644 --- a/pycgmes/resources/PhaseTapChangerAsymmetrical.py +++ b/pycgmes/resources/PhaseTapChangerAsymmetrical.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PhaseTapChangerNonLinear import PhaseTapChangerNonLinear -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerAsymmetrical(PhaseTapChangerNonLinear): """ Describes the tap model for an asymmetrical phase shifting transformer in which the difference voltage vector adds @@ -33,9 +32,11 @@ class PhaseTapChangerAsymmetrical(PhaseTapChangerNonLinear): windingConnectionAngle: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhaseTapChangerLinear.py b/pycgmes/resources/PhaseTapChangerLinear.py index b6e0c89c..130bf9a6 100644 --- a/pycgmes/resources/PhaseTapChangerLinear.py +++ b/pycgmes/resources/PhaseTapChangerLinear.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PhaseTapChanger import PhaseTapChanger -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerLinear(PhaseTapChanger): """ Describes a tap changer with a linear relation between the tap step and the phase angle difference across the @@ -40,23 +39,29 @@ class PhaseTapChangerLinear(PhaseTapChanger): stepPhaseShiftIncrement: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xMax: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xMin: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhaseTapChangerNonLinear.py b/pycgmes/resources/PhaseTapChangerNonLinear.py index ccc730bc..3a98e783 100644 --- a/pycgmes/resources/PhaseTapChangerNonLinear.py +++ b/pycgmes/resources/PhaseTapChangerNonLinear.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PhaseTapChanger import PhaseTapChanger -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerNonLinear(PhaseTapChanger): """ The non-linear phase tap changer describes the non-linear behaviour of a phase tap changer. This is a base class for @@ -38,23 +37,29 @@ class PhaseTapChangerNonLinear(PhaseTapChanger): voltageStepIncrement: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xMax: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) xMin: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhaseTapChangerSymmetrical.py b/pycgmes/resources/PhaseTapChangerSymmetrical.py index eafb0dcd..4a90c54c 100644 --- a/pycgmes/resources/PhaseTapChangerSymmetrical.py +++ b/pycgmes/resources/PhaseTapChangerSymmetrical.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PhaseTapChangerNonLinear import PhaseTapChangerNonLinear -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerSymmetrical(PhaseTapChangerNonLinear): """ Describes a symmetrical phase shifting transformer tap model in which the voltage magnitude of both sides is the diff --git a/pycgmes/resources/PhaseTapChangerTable.py b/pycgmes/resources/PhaseTapChangerTable.py index d509fe4e..d9888a5e 100644 --- a/pycgmes/resources/PhaseTapChangerTable.py +++ b/pycgmes/resources/PhaseTapChangerTable.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerTable(IdentifiedObject): """ Describes a tabular curve for how the phase angle difference and impedance varies with the tap step. @@ -25,12 +24,12 @@ class PhaseTapChangerTable(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # PhaseTapChangerTablePoint : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # PhaseTapChangerTablePoint : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # PhaseTapChangerTabular : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # PhaseTapChangerTabular : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PhaseTapChangerTablePoint.py b/pycgmes/resources/PhaseTapChangerTablePoint.py index 44df0777..c0bf90a7 100644 --- a/pycgmes/resources/PhaseTapChangerTablePoint.py +++ b/pycgmes/resources/PhaseTapChangerTablePoint.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TapChangerTablePoint import TapChangerTablePoint -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerTablePoint(TapChangerTablePoint): """ Describes each tap step in the phase tap changer tabular curve. @@ -29,16 +28,20 @@ class PhaseTapChangerTablePoint(TapChangerTablePoint): PhaseTapChangerTable: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) angle: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhaseTapChangerTabular.py b/pycgmes/resources/PhaseTapChangerTabular.py index 78a6f149..97a084b8 100644 --- a/pycgmes/resources/PhaseTapChangerTabular.py +++ b/pycgmes/resources/PhaseTapChangerTabular.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PhaseTapChanger import PhaseTapChanger -@dataclass(config=DataclassConfig) +@dataclass class PhaseTapChangerTabular(PhaseTapChanger): """ Describes a tap changer with a table defining the relation between the tap step and the phase angle difference @@ -28,9 +27,11 @@ class PhaseTapChangerTabular(PhaseTapChanger): PhaseTapChangerTable: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PhotoVoltaicUnit.py b/pycgmes/resources/PhotoVoltaicUnit.py index 5692368b..2747842e 100644 --- a/pycgmes/resources/PhotoVoltaicUnit.py +++ b/pycgmes/resources/PhotoVoltaicUnit.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerElectronicsUnit import PowerElectronicsUnit -@dataclass(config=DataclassConfig) +@dataclass class PhotoVoltaicUnit(PowerElectronicsUnit): """ A photovoltaic device or an aggregation of such devices. diff --git a/pycgmes/resources/PositionPoint.py b/pycgmes/resources/PositionPoint.py index d064789a..c1aaed2e 100644 --- a/pycgmes/resources/PositionPoint.py +++ b/pycgmes/resources/PositionPoint.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class PositionPoint(Base): """ Set of spatial coordinates that determine a point, defined in the coordinate system specified in @@ -35,37 +34,47 @@ class PositionPoint(Base): Location: Optional[str] = Field( default=None, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) sequenceNumber: int = Field( default=0, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) xPosition: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) yPosition: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) zPosition: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PostLineSensor.py b/pycgmes/resources/PostLineSensor.py index e740d0f8..351f5e2c 100644 --- a/pycgmes/resources/PostLineSensor.py +++ b/pycgmes/resources/PostLineSensor.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Sensor import Sensor -@dataclass(config=DataclassConfig) +@dataclass class PostLineSensor(Sensor): """ A sensor used mainly in overhead distribution networks as the source of both current and voltage measurements. diff --git a/pycgmes/resources/PotentialTransformer.py b/pycgmes/resources/PotentialTransformer.py index 865a31ba..31258a32 100644 --- a/pycgmes/resources/PotentialTransformer.py +++ b/pycgmes/resources/PotentialTransformer.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Sensor import Sensor -@dataclass(config=DataclassConfig) +@dataclass class PotentialTransformer(Sensor): """ Instrument transformer (also known as Voltage Transformer) used to measure electrical qualities of the circuit that diff --git a/pycgmes/resources/PowerElectronicsConnection.py b/pycgmes/resources/PowerElectronicsConnection.py index 3742f918..15d29d05 100644 --- a/pycgmes/resources/PowerElectronicsConnection.py +++ b/pycgmes/resources/PowerElectronicsConnection.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingCondEq import RegulatingCondEq -@dataclass(config=DataclassConfig) +@dataclass class PowerElectronicsConnection(RegulatingCondEq): """ A connection to the AC network for energy production or consumption that uses power electronics rather than rotating @@ -39,56 +38,70 @@ class PowerElectronicsConnection(RegulatingCondEq): maxQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedS: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedU: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) PowerElectronicsUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3or4Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PowerElectronicsUnit.py b/pycgmes/resources/PowerElectronicsUnit.py index f533507b..58636a7b 100644 --- a/pycgmes/resources/PowerElectronicsUnit.py +++ b/pycgmes/resources/PowerElectronicsUnit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Equipment import Equipment -@dataclass(config=DataclassConfig) +@dataclass class PowerElectronicsUnit(Equipment): """ A generating unit or battery or aggregation that connects to the AC network using power electronics rather than @@ -28,21 +27,25 @@ class PowerElectronicsUnit(Equipment): """ # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # PowerElectronicsConnection : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:1 in CIM + # PowerElectronicsConnection : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 maxP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minP: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PowerElectronicsWindUnit.py b/pycgmes/resources/PowerElectronicsWindUnit.py index f531a96e..db080073 100644 --- a/pycgmes/resources/PowerElectronicsWindUnit.py +++ b/pycgmes/resources/PowerElectronicsWindUnit.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerElectronicsUnit import PowerElectronicsUnit -@dataclass(config=DataclassConfig) +@dataclass class PowerElectronicsWindUnit(PowerElectronicsUnit): """ A wind generating unit that connects to the AC network with power electronics rather than rotating machines or an diff --git a/pycgmes/resources/PowerSystemResource.py b/pycgmes/resources/PowerSystemResource.py index fd715069..c2c3cb4a 100644 --- a/pycgmes/resources/PowerSystemResource.py +++ b/pycgmes/resources/PowerSystemResource.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class PowerSystemResource(IdentifiedObject): """ A power system resource (PSR) can be an item of equipment such as a switch, an equipment container containing many @@ -29,16 +28,16 @@ class PowerSystemResource(IdentifiedObject): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # Location : Optional[str] = Field(default=None, in_profiles = [Profile.GL, ]) + # Type M:0..1 in CIM + # Location : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.GL, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Controls : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Controls : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Measurements : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Measurements : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PowerSystemStabilizerDynamics.py b/pycgmes/resources/PowerSystemStabilizerDynamics.py index ab6e7afe..1e595922 100644 --- a/pycgmes/resources/PowerSystemStabilizerDynamics.py +++ b/pycgmes/resources/PowerSystemStabilizerDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class PowerSystemStabilizerDynamics(DynamicsFunctionBlock): """ Power system stabilizer function block whose behaviour is described by reference to a standard model or by @@ -28,14 +27,16 @@ class PowerSystemStabilizerDynamics(DynamicsFunctionBlock): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # RemoteInputSignal : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PowerSystemStabilizerUserDefined.py b/pycgmes/resources/PowerSystemStabilizerUserDefined.py index 4cb89aac..b504d71c 100644 --- a/pycgmes/resources/PowerSystemStabilizerUserDefined.py +++ b/pycgmes/resources/PowerSystemStabilizerUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PowerSystemStabilizerUserDefined(PowerSystemStabilizerDynamics): """ Power system stabilizer function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class PowerSystemStabilizerUserDefined(PowerSystemStabilizerDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/PowerTransformer.py b/pycgmes/resources/PowerTransformer.py index 5d55bf24..d4cd1b99 100644 --- a/pycgmes/resources/PowerTransformer.py +++ b/pycgmes/resources/PowerTransformer.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class PowerTransformer(ConductingEquipment): """ An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing @@ -54,49 +53,61 @@ class PowerTransformer(ConductingEquipment): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # PowerTransformerEnd : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # PowerTransformerEnd : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 beforeShCircuitHighestOperatingCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) beforeShCircuitHighestOperatingVoltage: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) beforeShortCircuitAnglePf: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) highSideMinOperatingU: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) isPartOfGeneratorUnit: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) operationalValuesConsidered: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PowerTransformerEnd.py b/pycgmes/resources/PowerTransformerEnd.py index 8998e56f..b629c131 100644 --- a/pycgmes/resources/PowerTransformerEnd.py +++ b/pycgmes/resources/PowerTransformerEnd.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TransformerEnd import TransformerEnd -@dataclass(config=DataclassConfig) +@dataclass class PowerTransformerEnd(TransformerEnd): """ A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impedance values r, r0, x, and x0 @@ -63,93 +62,119 @@ class PowerTransformerEnd(TransformerEnd): PowerTransformer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) b: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) connectionKind: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedS: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) g: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedU: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) b0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) phaseAngleClock: int = Field( default=0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) g0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ProprietaryParameterDynamics.py b/pycgmes/resources/ProprietaryParameterDynamics.py index edcc9400..bf9f1da0 100644 --- a/pycgmes/resources/ProprietaryParameterDynamics.py +++ b/pycgmes/resources/ProprietaryParameterDynamics.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ProprietaryParameterDynamics(Base): """ Supports definition of one or more parameters of several different datatypes for use by proprietary user-defined @@ -57,177 +56,227 @@ class ProprietaryParameterDynamics(Base): CSCUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) SVCUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) VSCUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPlantUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindType1or2UserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindType3or4UserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) SynchronousMachineUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) AsynchronousMachineUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) TurbineGovernorUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) TurbineLoadControllerUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) MechanicalLoadUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ExcitationSystemUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) OverexcitationLimiterUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) UnderexcitationLimiterUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) PowerSystemStabilizerUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) DiscontinuousExcitationControlUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) PFVArControllerType1UserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) VoltageAdjusterUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) PFVArControllerType2UserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) VoltageCompensatorUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) LoadUserDefined: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) parameterNumber: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) booleanParameterValue: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) integerParameterValue: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) floatParameterValue: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ProtectedSwitch.py b/pycgmes/resources/ProtectedSwitch.py index d7520f70..6daa6ec3 100644 --- a/pycgmes/resources/ProtectedSwitch.py +++ b/pycgmes/resources/ProtectedSwitch.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Switch import Switch -@dataclass(config=DataclassConfig) +@dataclass class ProtectedSwitch(Switch): """ A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment. diff --git a/pycgmes/resources/Pss1.py b/pycgmes/resources/Pss1.py index 1fbdcd45..0dfcc936 100644 --- a/pycgmes/resources/Pss1.py +++ b/pycgmes/resources/Pss1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class Pss1(PowerSystemStabilizerDynamics): """ Italian PSS with three inputs (speed, frequency, power). @@ -41,107 +40,137 @@ class Pss1(PowerSystemStabilizerDynamics): komega: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpe: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpe: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vadat: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Pss1A.py b/pycgmes/resources/Pss1A.py index 2425de91..1a1fdc38 100644 --- a/pycgmes/resources/Pss1A.py +++ b/pycgmes/resources/Pss1A.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class Pss1A(PowerSystemStabilizerDynamics): """ Single input power system stabilizer. It is a modified version in order to allow representation of various vendors' @@ -50,156 +49,200 @@ class Pss1A(PowerSystemStabilizerDynamics): inputSignalType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kd: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdelay: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Pss2B.py b/pycgmes/resources/Pss2B.py index 3182adf9..d7082530 100644 --- a/pycgmes/resources/Pss2B.py +++ b/pycgmes/resources/Pss2B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class Pss2B(PowerSystemStabilizerDynamics): """ Modified IEEE PSS2B. Extra lead/lag (or rate) block added at end (up to 4 lead/lags total). @@ -54,205 +53,263 @@ class Pss2B(PowerSystemStabilizerDynamics): vsi1max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi1min: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi2max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi2min: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t11: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) n: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) m: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Pss2ST.py b/pycgmes/resources/Pss2ST.py index 7e9f84b2..8d86916f 100644 --- a/pycgmes/resources/Pss2ST.py +++ b/pycgmes/resources/Pss2ST.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class Pss2ST(PowerSystemStabilizerDynamics): """ PTI microprocessor-based stabilizer type 1. @@ -49,128 +48,164 @@ class Pss2ST(PowerSystemStabilizerDynamics): inputSignal1Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal2Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Pss5.py b/pycgmes/resources/Pss5.py index 657a6b39..4d65158a 100644 --- a/pycgmes/resources/Pss5.py +++ b/pycgmes/resources/Pss5.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class Pss5(PowerSystemStabilizerDynamics): """ Detailed Italian PSS. @@ -46,121 +45,155 @@ class Pss5(PowerSystemStabilizerDynamics): kpe: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) isfreq: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpss: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ctw2: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmn: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpe: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) deadband: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vadat: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssELIN2.py b/pycgmes/resources/PssELIN2.py index e5a67705..2fd3044a 100644 --- a/pycgmes/resources/PssELIN2.py +++ b/pycgmes/resources/PssELIN2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssELIN2(PowerSystemStabilizerDynamics): """ Power system stabilizer typically associated with ExcELIN2 (though PssIEEE2B or Pss2B can also be used). @@ -36,79 +35,101 @@ class PssELIN2(PowerSystemStabilizerDynamics): ts1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ts6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ppss: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) apss: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) psslim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssIEEE1A.py b/pycgmes/resources/PssIEEE1A.py index 02a9f22a..a1bcba5c 100644 --- a/pycgmes/resources/PssIEEE1A.py +++ b/pycgmes/resources/PssIEEE1A.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssIEEE1A(PowerSystemStabilizerDynamics): """ IEEE 421.5-2005 type PSS1A power system stabilizer model. PSS1A is the generalized form of a PSS with a single input @@ -40,86 +39,110 @@ class PssIEEE1A(PowerSystemStabilizerDynamics): inputSignalType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vrmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssIEEE2B.py b/pycgmes/resources/PssIEEE2B.py index 9d9d6b7d..6580363a 100644 --- a/pycgmes/resources/PssIEEE2B.py +++ b/pycgmes/resources/PssIEEE2B.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssIEEE2B(PowerSystemStabilizerDynamics): """ IEEE 421.5-2005 type PSS2B power system stabilizer model. This stabilizer model is designed to represent a variety @@ -56,191 +55,245 @@ class PssIEEE2B(PowerSystemStabilizerDynamics): inputSignal1Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal2Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi1max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi1min: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi2max: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsi2min: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t11: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) n: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) m: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssIEEE3B.py b/pycgmes/resources/PssIEEE3B.py index a8338f23..ec67bdba 100644 --- a/pycgmes/resources/PssIEEE3B.py +++ b/pycgmes/resources/PssIEEE3B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssIEEE3B(PowerSystemStabilizerDynamics): """ IEEE 421.5-2005 type PSS3B power system stabilizer model. The PSS model PSS3B has dual inputs of electrical power @@ -46,121 +45,155 @@ class PssIEEE3B(PowerSystemStabilizerDynamics): t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tw3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssIEEE4B.py b/pycgmes/resources/PssIEEE4B.py index 8d7dea72..4f368992 100644 --- a/pycgmes/resources/PssIEEE4B.py +++ b/pycgmes/resources/PssIEEE4B.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssIEEE4B(PowerSystemStabilizerDynamics): """ IEEE 421.5-2005 type PSS4B power system stabilizer. The PSS4B model represents a structure based on multiple working @@ -98,471 +97,605 @@ class PssIEEE4B(PowerSystemStabilizerDynamics): bwh1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bwh2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bwl1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) bwl2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh11: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh17: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kh2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki11: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki17: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl11: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl17: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kl2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omeganh1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omeganh2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omeganl1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omeganl2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th11: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th12: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) th9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti11: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti12: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ti9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl11: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl12: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tl9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vhmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vhmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vlmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vstmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssPTIST1.py b/pycgmes/resources/PssPTIST1.py index cf4b3e38..f9346e14 100644 --- a/pycgmes/resources/PssPTIST1.py +++ b/pycgmes/resources/PssPTIST1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssPTIST1(PowerSystemStabilizerDynamics): """ PTI microprocessor-based stabilizer type 1. @@ -36,79 +35,101 @@ class PssPTIST1(PowerSystemStabilizerDynamics): m: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssPTIST3.py b/pycgmes/resources/PssPTIST3.py index 89dca839..58377199 100644 --- a/pycgmes/resources/PssPTIST3.py +++ b/pycgmes/resources/PssPTIST3.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssPTIST3(PowerSystemStabilizerDynamics): """ PTI microprocessor-based stabilizer type 3. @@ -60,240 +59,308 @@ class PssPTIST3(PowerSystemStabilizerDynamics): m: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtf: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dtp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) a5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) b5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) athres: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) al: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lthres: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) isw: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) nav: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ncl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ncr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssRQB.py b/pycgmes/resources/PssRQB.py index c1cea151..601729e3 100644 --- a/pycgmes/resources/PssRQB.py +++ b/pycgmes/resources/PssRQB.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssRQB(PowerSystemStabilizerDynamics): """ Power system stabilizer type RQB. This power system stabilizer is intended to be used together with excitation @@ -36,72 +35,92 @@ class PssRQB(PowerSystemStabilizerDynamics): ki2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4m: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tomd: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tomsl: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4mom: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) sibv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdpm: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4f: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssSB4.py b/pycgmes/resources/PssSB4.py index 1032c5c9..405bb192 100644 --- a/pycgmes/resources/PssSB4.py +++ b/pycgmes/resources/PssSB4.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssSB4(PowerSystemStabilizerDynamics): """ Power sensitive stabilizer model. @@ -36,79 +35,101 @@ class PssSB4(PowerSystemStabilizerDynamics): tt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tx2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tx1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tb: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) te: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssSH.py b/pycgmes/resources/PssSH.py index aba569f5..925b0460 100644 --- a/pycgmes/resources/PssSH.py +++ b/pycgmes/resources/PssSH.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssSH(PowerSystemStabilizerDynamics): """ SiemensTM "H infinity" power system stabilizer with generator electrical power input. [Footnote: Siemens "H @@ -41,93 +40,119 @@ class PssSH(PowerSystemStabilizerDynamics): k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) td: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssSK.py b/pycgmes/resources/PssSK.py index 7aa5d6ec..e45e91cc 100644 --- a/pycgmes/resources/PssSK.py +++ b/pycgmes/resources/PssSK.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssSK(PowerSystemStabilizerDynamics): """ Slovakian PSS with three inputs. @@ -36,79 +35,101 @@ class PssSK(PowerSystemStabilizerDynamics): k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssSTAB2A.py b/pycgmes/resources/PssSTAB2A.py index 219872da..a9a437e4 100644 --- a/pycgmes/resources/PssSTAB2A.py +++ b/pycgmes/resources/PssSTAB2A.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssSTAB2A(PowerSystemStabilizerDynamics): """ Power system stabilizer part of an ABB excitation system. [Footnote: ABB excitation systems are an example of @@ -35,58 +34,74 @@ class PssSTAB2A(PowerSystemStabilizerDynamics): k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hlim: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/PssWECC.py b/pycgmes/resources/PssWECC.py index 7b37ab4b..d0d5ea00 100644 --- a/pycgmes/resources/PssWECC.py +++ b/pycgmes/resources/PssWECC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemStabilizerDynamics import PowerSystemStabilizerDynamics -@dataclass(config=DataclassConfig) +@dataclass class PssWECC(PowerSystemStabilizerDynamics): """ Dual input power system stabilizer, based on IEEE type 2, with modified output limiter defined by WECC (Western @@ -50,128 +49,164 @@ class PssWECC(PowerSystemStabilizerDynamics): inputSignal1Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inputSignal2Type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t5: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t6: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t7: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t8: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t10: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t9: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vsmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vcl: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Quality61850.py b/pycgmes/resources/Quality61850.py index 5a7597a3..d4d88f2d 100644 --- a/pycgmes/resources/Quality61850.py +++ b/pycgmes/resources/Quality61850.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Quality61850(Base): """ Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in @@ -55,86 +54,110 @@ class Quality61850(Base): badReference: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) estimatorReplaced: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) failure: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) oldData: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) operatorBlocked: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) oscillatory: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) outOfRange: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) overFlow: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) source: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) suspect: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) test: bool = Field( default=False, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) validity: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RaiseLowerCommand.py b/pycgmes/resources/RaiseLowerCommand.py index a2c91670..dbdc072f 100644 --- a/pycgmes/resources/RaiseLowerCommand.py +++ b/pycgmes/resources/RaiseLowerCommand.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AnalogControl import AnalogControl -@dataclass(config=DataclassConfig) +@dataclass class RaiseLowerCommand(AnalogControl): """ An analog control that increases or decreases a set point value with pulses. Unless otherwise specified, one pulse @@ -28,9 +27,11 @@ class RaiseLowerCommand(AnalogControl): ValueAliasSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RatioTapChanger.py b/pycgmes/resources/RatioTapChanger.py index acd771ab..101eac42 100644 --- a/pycgmes/resources/RatioTapChanger.py +++ b/pycgmes/resources/RatioTapChanger.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TapChanger import TapChanger -@dataclass(config=DataclassConfig) +@dataclass class RatioTapChanger(TapChanger): """ A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the @@ -33,23 +32,29 @@ class RatioTapChanger(TapChanger): stepVoltageIncrement: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) RatioTapChangerTable: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) TransformerEnd: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RatioTapChangerTable.py b/pycgmes/resources/RatioTapChangerTable.py index 9b13d137..e90e9e48 100644 --- a/pycgmes/resources/RatioTapChangerTable.py +++ b/pycgmes/resources/RatioTapChangerTable.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class RatioTapChangerTable(IdentifiedObject): """ Describes a curve for how the voltage magnitude and impedance varies with the tap step. @@ -25,12 +24,12 @@ class RatioTapChangerTable(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RatioTapChanger : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # RatioTapChanger : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # RatioTapChangerTablePoint : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # RatioTapChangerTablePoint : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/RatioTapChangerTablePoint.py b/pycgmes/resources/RatioTapChangerTablePoint.py index edcdb32e..d82c10ff 100644 --- a/pycgmes/resources/RatioTapChangerTablePoint.py +++ b/pycgmes/resources/RatioTapChangerTablePoint.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TapChangerTablePoint import TapChangerTablePoint -@dataclass(config=DataclassConfig) +@dataclass class RatioTapChangerTablePoint(TapChangerTablePoint): """ Describes each tap step in the ratio tap changer tabular curve. @@ -27,9 +26,11 @@ class RatioTapChangerTablePoint(TapChangerTablePoint): RatioTapChangerTable: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Reactance.py b/pycgmes/resources/Reactance.py index 2acf6ba5..15d1d573 100644 --- a/pycgmes/resources/Reactance.py +++ b/pycgmes/resources/Reactance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Reactance(Base): """ Reactance (imaginary part of impedance), at rated frequency. @@ -29,26 +28,32 @@ class Reactance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ReactiveCapabilityCurve.py b/pycgmes/resources/ReactiveCapabilityCurve.py index 13c584ff..913c95ba 100644 --- a/pycgmes/resources/ReactiveCapabilityCurve.py +++ b/pycgmes/resources/ReactiveCapabilityCurve.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Curve import Curve -@dataclass(config=DataclassConfig) +@dataclass class ReactiveCapabilityCurve(Curve): """ Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring @@ -28,12 +27,12 @@ class ReactiveCapabilityCurve(Curve): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # EquivalentInjection : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # EquivalentInjection : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # InitiallyUsedBySynchronousMachines : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # InitiallyUsedBySynchronousMachines : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ReactivePower.py b/pycgmes/resources/ReactivePower.py index 46a6bed4..91151900 100644 --- a/pycgmes/resources/ReactivePower.py +++ b/pycgmes/resources/ReactivePower.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ReactivePower(Base): """ Product of RMS value of the voltage and the RMS value of the quadrature component of the current. @@ -29,29 +28,35 @@ class ReactivePower(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SV, + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SV, + Profile.SSH, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SV, + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RealEnergy.py b/pycgmes/resources/RealEnergy.py index f08eeb3e..ab5c2323 100644 --- a/pycgmes/resources/RealEnergy.py +++ b/pycgmes/resources/RealEnergy.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RealEnergy(Base): """ Real electrical energy. @@ -29,26 +28,32 @@ class RealEnergy(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RegularIntervalSchedule.py b/pycgmes/resources/RegularIntervalSchedule.py index a6ece7fc..2c5da857 100644 --- a/pycgmes/resources/RegularIntervalSchedule.py +++ b/pycgmes/resources/RegularIntervalSchedule.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .BasicIntervalSchedule import BasicIntervalSchedule -@dataclass(config=DataclassConfig) +@dataclass class RegularIntervalSchedule(BasicIntervalSchedule): """ The schedule has time points where the time between them is constant. @@ -27,21 +26,25 @@ class RegularIntervalSchedule(BasicIntervalSchedule): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # TimePoints : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # TimePoints : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) timeStep: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) endTime: str = Field( default="", - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RegularTimePoint.py b/pycgmes/resources/RegularTimePoint.py index 846ff916..94b58193 100644 --- a/pycgmes/resources/RegularTimePoint.py +++ b/pycgmes/resources/RegularTimePoint.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RegularTimePoint(Base): """ Time point for a schedule where the time between the consecutive points is constant. @@ -36,30 +35,38 @@ class RegularTimePoint(Base): sequenceNumber: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value1: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value2: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) IntervalSchedule: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RegulatingCondEq.py b/pycgmes/resources/RegulatingCondEq.py index 84906764..a7039575 100644 --- a/pycgmes/resources/RegulatingCondEq.py +++ b/pycgmes/resources/RegulatingCondEq.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConnection import EnergyConnection -@dataclass(config=DataclassConfig) +@dataclass class RegulatingCondEq(EnergyConnection): """ A type of conducting equipment that can regulate a quantity (i.e. voltage or flow) at a specific point in the @@ -29,16 +28,20 @@ class RegulatingCondEq(EnergyConnection): RegulatingControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) controlEnabled: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RegulatingControl.py b/pycgmes/resources/RegulatingControl.py index dad18920..ca8d100e 100644 --- a/pycgmes/resources/RegulatingControl.py +++ b/pycgmes/resources/RegulatingControl.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class RegulatingControl(PowerSystemResource): """ Specifies a set of equipment that works together to control a power system quantity such as voltage or flow. Remote @@ -62,74 +61,92 @@ class RegulatingControl(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RegulationSchedule : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # RegulationSchedule : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RegulatingCondEq : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # RegulatingCondEq : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 mode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) discrete: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) enabled: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetDeadband: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetValue: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetValueUnitMultiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) maxAllowedTargetValue: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) minAllowedTargetValue: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RegulatingControlModeKind.py b/pycgmes/resources/RegulatingControlModeKind.py index 571ce8fc..7369734e 100644 --- a/pycgmes/resources/RegulatingControlModeKind.py +++ b/pycgmes/resources/RegulatingControlModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RegulatingControlModeKind(Base): """ The kind of regulation model. For example regulating voltage, reactive power, active power, etc. diff --git a/pycgmes/resources/RegulationSchedule.py b/pycgmes/resources/RegulationSchedule.py index 34b8f0fa..819bc988 100644 --- a/pycgmes/resources/RegulationSchedule.py +++ b/pycgmes/resources/RegulationSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SeasonDayTypeSchedule import SeasonDayTypeSchedule -@dataclass(config=DataclassConfig) +@dataclass class RegulationSchedule(SeasonDayTypeSchedule): """ A pre-established pattern over time for a controlled variable, e.g., busbar voltage. @@ -27,9 +26,11 @@ class RegulationSchedule(SeasonDayTypeSchedule): RegulatingControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RemoteInputSignal.py b/pycgmes/resources/RemoteInputSignal.py index b36dcfde..076b9eb6 100644 --- a/pycgmes/resources/RemoteInputSignal.py +++ b/pycgmes/resources/RemoteInputSignal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class RemoteInputSignal(IdentifiedObject): """ Supports connection to a terminal associated with a remote bus from which an input signal of a specific type is @@ -37,64 +36,78 @@ class RemoteInputSignal(IdentifiedObject): Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) remoteSignalType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) DiscontinuousExcitationControlDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType1or2Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType1or2Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 PowerSystemStabilizerDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) UnderexcitationLimiterDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) PFVArControllerType1Dynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) VoltageCompensatorDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindPlantDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindPlantDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4Dynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3or4Dynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/RemoteSignalKind.py b/pycgmes/resources/RemoteSignalKind.py index bd9f8fbc..99a8a614 100644 --- a/pycgmes/resources/RemoteSignalKind.py +++ b/pycgmes/resources/RemoteSignalKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RemoteSignalKind(Base): """ Type of input signal coming from remote bus. diff --git a/pycgmes/resources/ReportingGroup.py b/pycgmes/resources/ReportingGroup.py index 3839572d..b24aeebe 100644 --- a/pycgmes/resources/ReportingGroup.py +++ b/pycgmes/resources/ReportingGroup.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ReportingGroup(IdentifiedObject): """ A reporting group is used for various ad-hoc groupings used for reporting. @@ -25,12 +24,12 @@ class ReportingGroup(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TopologicalNode : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # TopologicalNode : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # BusNameMarker : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # BusNameMarker : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Resistance.py b/pycgmes/resources/Resistance.py index 56607760..24080aab 100644 --- a/pycgmes/resources/Resistance.py +++ b/pycgmes/resources/Resistance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Resistance(Base): """ Resistance (real part of impedance). @@ -29,29 +28,35 @@ class Resistance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RotatingMachine.py b/pycgmes/resources/RotatingMachine.py index 540ff356..2bdbd775 100644 --- a/pycgmes/resources/RotatingMachine.py +++ b/pycgmes/resources/RotatingMachine.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingCondEq import RegulatingCondEq -@dataclass(config=DataclassConfig) +@dataclass class RotatingMachine(RegulatingCondEq): """ A rotating machine which may be used as a generator or motor. @@ -39,48 +38,60 @@ class RotatingMachine(RegulatingCondEq): GeneratingUnit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # HydroPump : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:0..1 in CIM + # HydroPump : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) ratedPowerFactor: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedS: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedU: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) p: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RotatingMachineDynamics.py b/pycgmes/resources/RotatingMachineDynamics.py index 8a3a21ca..c1b870d9 100644 --- a/pycgmes/resources/RotatingMachineDynamics.py +++ b/pycgmes/resources/RotatingMachineDynamics.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class RotatingMachineDynamics(DynamicsFunctionBlock): """ Abstract parent class for all synchronous and asynchronous machine standard models. @@ -43,44 +42,56 @@ class RotatingMachineDynamics(DynamicsFunctionBlock): damping: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) inertia: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) saturationFactor: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) saturationFactor120: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) statorLeakageReactance: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) statorResistance: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RotationSpeed.py b/pycgmes/resources/RotationSpeed.py index c077fc29..1b3f44e2 100644 --- a/pycgmes/resources/RotationSpeed.py +++ b/pycgmes/resources/RotationSpeed.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RotationSpeed(Base): """ Number of revolutions per second. @@ -29,23 +28,29 @@ class RotationSpeed(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/RotorKind.py b/pycgmes/resources/RotorKind.py index 443db909..2b437a2e 100644 --- a/pycgmes/resources/RotorKind.py +++ b/pycgmes/resources/RotorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class RotorKind(Base): """ Type of rotor on physical machine. diff --git a/pycgmes/resources/SVCControlMode.py b/pycgmes/resources/SVCControlMode.py index 16f201a3..97fe8bc8 100644 --- a/pycgmes/resources/SVCControlMode.py +++ b/pycgmes/resources/SVCControlMode.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SVCControlMode(Base): """ Static VAr Compensator control mode. diff --git a/pycgmes/resources/SVCUserDefined.py b/pycgmes/resources/SVCUserDefined.py index 105796f1..40c9560b 100644 --- a/pycgmes/resources/SVCUserDefined.py +++ b/pycgmes/resources/SVCUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .StaticVarCompensatorDynamics import StaticVarCompensatorDynamics -@dataclass(config=DataclassConfig) +@dataclass class SVCUserDefined(StaticVarCompensatorDynamics): """ Static var compensator (SVC) function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class SVCUserDefined(StaticVarCompensatorDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Season.py b/pycgmes/resources/Season.py index 6a14d678..723287af 100644 --- a/pycgmes/resources/Season.py +++ b/pycgmes/resources/Season.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class Season(IdentifiedObject): """ A specified time period of the year. @@ -28,21 +27,25 @@ class Season(IdentifiedObject): endDate: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) startDate: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # SeasonDayTypeSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # SeasonDayTypeSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/SeasonDayTypeSchedule.py b/pycgmes/resources/SeasonDayTypeSchedule.py index 986f16be..b3f73154 100644 --- a/pycgmes/resources/SeasonDayTypeSchedule.py +++ b/pycgmes/resources/SeasonDayTypeSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegularIntervalSchedule import RegularIntervalSchedule -@dataclass(config=DataclassConfig) +@dataclass class SeasonDayTypeSchedule(RegularIntervalSchedule): """ A time schedule covering a 24 hour period, with curve data for a specific type of season and day. @@ -28,16 +27,20 @@ class SeasonDayTypeSchedule(RegularIntervalSchedule): DayType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) Season: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Seconds.py b/pycgmes/resources/Seconds.py index c537a330..2ca427fb 100644 --- a/pycgmes/resources/Seconds.py +++ b/pycgmes/resources/Seconds.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Seconds(Base): """ Time, in seconds. @@ -29,26 +28,32 @@ class Seconds(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Sensor.py b/pycgmes/resources/Sensor.py index 6d709404..c0e79d1b 100644 --- a/pycgmes/resources/Sensor.py +++ b/pycgmes/resources/Sensor.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AuxiliaryEquipment import AuxiliaryEquipment -@dataclass(config=DataclassConfig) +@dataclass class Sensor(AuxiliaryEquipment): """ This class describe devices that transform a measured quantity into signals that can be presented at displays, used diff --git a/pycgmes/resources/SeriesCompensator.py b/pycgmes/resources/SeriesCompensator.py index bc284f76..fbc723d2 100644 --- a/pycgmes/resources/SeriesCompensator.py +++ b/pycgmes/resources/SeriesCompensator.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class SeriesCompensator(ConductingEquipment): """ A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It @@ -37,51 +36,65 @@ class SeriesCompensator(ConductingEquipment): r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) varistorPresent: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) varistorRatedCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) varistorVoltageThreshold: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ServiceLocation.py b/pycgmes/resources/ServiceLocation.py index b03f1203..89cf53d4 100644 --- a/pycgmes/resources/ServiceLocation.py +++ b/pycgmes/resources/ServiceLocation.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WorkLocation import WorkLocation -@dataclass(config=DataclassConfig) +@dataclass class ServiceLocation(WorkLocation): """ A real estate location, commonly referred to as premises. diff --git a/pycgmes/resources/SetPoint.py b/pycgmes/resources/SetPoint.py index 9fbc0fb2..07bba88b 100644 --- a/pycgmes/resources/SetPoint.py +++ b/pycgmes/resources/SetPoint.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AnalogControl import AnalogControl -@dataclass(config=DataclassConfig) +@dataclass class SetPoint(AnalogControl): """ An analog control that issues a set point value. @@ -27,16 +26,20 @@ class SetPoint(AnalogControl): normalValue: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ShortCircuitRotorKind.py b/pycgmes/resources/ShortCircuitRotorKind.py index 1369e150..688f5cbb 100644 --- a/pycgmes/resources/ShortCircuitRotorKind.py +++ b/pycgmes/resources/ShortCircuitRotorKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class ShortCircuitRotorKind(Base): """ Type of rotor, used by short circuit applications. diff --git a/pycgmes/resources/ShuntCompensator.py b/pycgmes/resources/ShuntCompensator.py index 2b33334c..0980ca52 100644 --- a/pycgmes/resources/ShuntCompensator.py +++ b/pycgmes/resources/ShuntCompensator.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingCondEq import RegulatingCondEq -@dataclass(config=DataclassConfig) +@dataclass class ShuntCompensator(RegulatingCondEq): """ A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is @@ -48,55 +47,69 @@ class ShuntCompensator(RegulatingCondEq): aVRDelay: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) grounded: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maximumSections: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) nomU: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) normalSections: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) voltageSensitivity: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvShuntCompensatorSections : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvShuntCompensatorSections : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # noqa: E501 sections: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SolarGeneratingUnit.py b/pycgmes/resources/SolarGeneratingUnit.py index 00b07212..b608be66 100644 --- a/pycgmes/resources/SolarGeneratingUnit.py +++ b/pycgmes/resources/SolarGeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .GeneratingUnit import GeneratingUnit -@dataclass(config=DataclassConfig) +@dataclass class SolarGeneratingUnit(GeneratingUnit): """ A solar thermal generating unit, connected to the grid by means of a rotating machine. This class does not @@ -28,9 +27,11 @@ class SolarGeneratingUnit(GeneratingUnit): SolarPowerPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SolarPowerPlant.py b/pycgmes/resources/SolarPowerPlant.py index a0ffd709..76ff403b 100644 --- a/pycgmes/resources/SolarPowerPlant.py +++ b/pycgmes/resources/SolarPowerPlant.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class SolarPowerPlant(PowerSystemResource): """ Solar power plant. @@ -24,8 +23,8 @@ class SolarPowerPlant(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # SolarGeneratingUnits : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # SolarGeneratingUnits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Source.py b/pycgmes/resources/Source.py index 5d31c9ad..70ab7a69 100644 --- a/pycgmes/resources/Source.py +++ b/pycgmes/resources/Source.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Source(Base): """ Source gives information related to the origin of a value. diff --git a/pycgmes/resources/StaticLoadModelKind.py b/pycgmes/resources/StaticLoadModelKind.py index 0a410635..e9f1f0aa 100644 --- a/pycgmes/resources/StaticLoadModelKind.py +++ b/pycgmes/resources/StaticLoadModelKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class StaticLoadModelKind(Base): """ Type of static load model. diff --git a/pycgmes/resources/StaticVarCompensator.py b/pycgmes/resources/StaticVarCompensator.py index 9e106830..532fb203 100644 --- a/pycgmes/resources/StaticVarCompensator.py +++ b/pycgmes/resources/StaticVarCompensator.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingCondEq import RegulatingCondEq -@dataclass(config=DataclassConfig) +@dataclass class StaticVarCompensator(RegulatingCondEq): """ A facility for providing variable and controllable shunt reactive power. The SVC typically consists of a stepdown @@ -44,49 +43,61 @@ class StaticVarCompensator(RegulatingCondEq): capacitiveRating: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) inductiveRating: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) slope: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) sVCControlMode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) voltageSetPoint: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # StaticVarCompensatorDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # StaticVarCompensatorDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/StaticVarCompensatorDynamics.py b/pycgmes/resources/StaticVarCompensatorDynamics.py index 239562cc..2d3b86f3 100644 --- a/pycgmes/resources/StaticVarCompensatorDynamics.py +++ b/pycgmes/resources/StaticVarCompensatorDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class StaticVarCompensatorDynamics(DynamicsFunctionBlock): """ Static var compensator whose behaviour is described by reference to a standard model or by definition of a user- @@ -28,9 +27,11 @@ class StaticVarCompensatorDynamics(DynamicsFunctionBlock): StaticVarCompensator: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/StationSupply.py b/pycgmes/resources/StationSupply.py index bd71a3db..83376d15 100644 --- a/pycgmes/resources/StationSupply.py +++ b/pycgmes/resources/StationSupply.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyConsumer import EnergyConsumer -@dataclass(config=DataclassConfig) +@dataclass class StationSupply(EnergyConsumer): """ Station supply with load derived from the station output. diff --git a/pycgmes/resources/Status.py b/pycgmes/resources/Status.py index b4f7b678..402e0e36 100644 --- a/pycgmes/resources/Status.py +++ b/pycgmes/resources/Status.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Status(Base): """ Current status information relevant to an entity. @@ -30,30 +29,38 @@ class Status(Base): value: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) dateTime: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) remark: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) reason: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/StreetAddress.py b/pycgmes/resources/StreetAddress.py index 750e8da6..4f8aa66d 100644 --- a/pycgmes/resources/StreetAddress.py +++ b/pycgmes/resources/StreetAddress.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class StreetAddress(Base): """ General purpose street and postal address information. @@ -31,44 +30,56 @@ class StreetAddress(Base): streetDetail: float = Field( default=0.0, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) townDetail: float = Field( default=0.0, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) status: float = Field( default=0.0, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) postalCode: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) poBox: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) language: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/StreetDetail.py b/pycgmes/resources/StreetDetail.py index 19ac5a74..8de87d55 100644 --- a/pycgmes/resources/StreetDetail.py +++ b/pycgmes/resources/StreetDetail.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class StreetDetail(Base): """ Street details, in the context of address. @@ -42,93 +41,119 @@ class StreetDetail(Base): number: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) name: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) suffix: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) prefix: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) type: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) code: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) buildingName: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) suiteNumber: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) addressGeneral: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) addressGeneral2: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) addressGeneral3: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) withinTownLimits: bool = Field( default=False, - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) floorIdentification: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/StringMeasurement.py b/pycgmes/resources/StringMeasurement.py index 061b49e1..7dc1dbb1 100644 --- a/pycgmes/resources/StringMeasurement.py +++ b/pycgmes/resources/StringMeasurement.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Measurement import Measurement -@dataclass(config=DataclassConfig) +@dataclass class StringMeasurement(Measurement): """ StringMeasurement represents a measurement with values of type string. @@ -24,8 +23,8 @@ class StringMeasurement(Measurement): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # StringMeasurementValues : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # StringMeasurementValues : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/StringMeasurementValue.py b/pycgmes/resources/StringMeasurementValue.py index f44d3409..ce739845 100644 --- a/pycgmes/resources/StringMeasurementValue.py +++ b/pycgmes/resources/StringMeasurementValue.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .MeasurementValue import MeasurementValue -@dataclass(config=DataclassConfig) +@dataclass class StringMeasurementValue(MeasurementValue): """ StringMeasurementValue represents a measurement value of type string. @@ -27,9 +26,11 @@ class StringMeasurementValue(MeasurementValue): StringMeasurement: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SubGeographicalRegion.py b/pycgmes/resources/SubGeographicalRegion.py index 9bddcbe3..5c21f44a 100644 --- a/pycgmes/resources/SubGeographicalRegion.py +++ b/pycgmes/resources/SubGeographicalRegion.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class SubGeographicalRegion(IdentifiedObject): """ A subset of a geographical region of a power system network model. @@ -30,23 +29,25 @@ class SubGeographicalRegion(IdentifiedObject): Region: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Lines : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Lines : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Substations : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Substations : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCLines : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCLines : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/SubLoadArea.py b/pycgmes/resources/SubLoadArea.py index 9ed0fa86..02bf46ec 100644 --- a/pycgmes/resources/SubLoadArea.py +++ b/pycgmes/resources/SubLoadArea.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EnergyArea import EnergyArea -@dataclass(config=DataclassConfig) +@dataclass class SubLoadArea(EnergyArea): """ The class is the second level in a hierarchical structure for grouping of loads for the purpose of load flow load @@ -29,14 +28,16 @@ class SubLoadArea(EnergyArea): LoadArea: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # LoadGroups : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # LoadGroups : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Substation.py b/pycgmes/resources/Substation.py index 0cc5109a..d065b8be 100644 --- a/pycgmes/resources/Substation.py +++ b/pycgmes/resources/Substation.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquipmentContainer import EquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class Substation(EquipmentContainer): """ A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk @@ -30,19 +29,21 @@ class Substation(EquipmentContainer): Region: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # VoltageLevels : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # VoltageLevels : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # DCConverterUnit : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # DCConverterUnit : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/SurgeArrester.py b/pycgmes/resources/SurgeArrester.py index 163a658c..9f8a3d85 100644 --- a/pycgmes/resources/SurgeArrester.py +++ b/pycgmes/resources/SurgeArrester.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AuxiliaryEquipment import AuxiliaryEquipment -@dataclass(config=DataclassConfig) +@dataclass class SurgeArrester(AuxiliaryEquipment): """ Shunt device, installed on the network, usually in the proximity of electrical equipment in order to protect the diff --git a/pycgmes/resources/Susceptance.py b/pycgmes/resources/Susceptance.py index 91385b2d..eea3d9a5 100644 --- a/pycgmes/resources/Susceptance.py +++ b/pycgmes/resources/Susceptance.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Susceptance(Base): """ Imaginary part of admittance. @@ -29,26 +28,32 @@ class Susceptance(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvInjection.py b/pycgmes/resources/SvInjection.py index d1785aec..81169726 100644 --- a/pycgmes/resources/SvInjection.py +++ b/pycgmes/resources/SvInjection.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvInjection(Base): """ The SvInjection reports the calculated bus injection minus the sum of the terminal flows. The terminal flow is @@ -33,23 +32,29 @@ class SvInjection(Base): pInjection: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) qInjection: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) TopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvPowerFlow.py b/pycgmes/resources/SvPowerFlow.py index 6701ec21..2026630d 100644 --- a/pycgmes/resources/SvPowerFlow.py +++ b/pycgmes/resources/SvPowerFlow.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvPowerFlow(Base): """ State variable for power flow. Load convention is used for flow direction. This means flow out from the @@ -32,23 +31,29 @@ class SvPowerFlow(Base): p: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) q: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvShuntCompensatorSections.py b/pycgmes/resources/SvShuntCompensatorSections.py index ef20816c..55aa7dd9 100644 --- a/pycgmes/resources/SvShuntCompensatorSections.py +++ b/pycgmes/resources/SvShuntCompensatorSections.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvShuntCompensatorSections(Base): """ State variable for the number of sections in service for a shunt compensator. @@ -29,16 +28,20 @@ class SvShuntCompensatorSections(Base): ShuntCompensator: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) sections: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvStatus.py b/pycgmes/resources/SvStatus.py index 7e474a7e..440ec4a5 100644 --- a/pycgmes/resources/SvStatus.py +++ b/pycgmes/resources/SvStatus.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvStatus(Base): """ State variable for status. @@ -30,16 +29,20 @@ class SvStatus(Base): ConductingEquipment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) inService: bool = Field( default=False, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvSwitch.py b/pycgmes/resources/SvSwitch.py index 3aeb9677..d44f2f1b 100644 --- a/pycgmes/resources/SvSwitch.py +++ b/pycgmes/resources/SvSwitch.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvSwitch(Base): """ State variable for switch. @@ -28,16 +27,20 @@ class SvSwitch(Base): open: bool = Field( default=False, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) Switch: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvTapStep.py b/pycgmes/resources/SvTapStep.py index d05dbff4..6d0e7fd5 100644 --- a/pycgmes/resources/SvTapStep.py +++ b/pycgmes/resources/SvTapStep.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvTapStep(Base): """ State variable for transformer tap step. @@ -30,16 +29,20 @@ class SvTapStep(Base): position: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) TapChanger: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SvVoltage.py b/pycgmes/resources/SvVoltage.py index 96850999..c8dc7f7f 100644 --- a/pycgmes/resources/SvVoltage.py +++ b/pycgmes/resources/SvVoltage.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SvVoltage(Base): """ State variable for voltage. @@ -29,23 +28,29 @@ class SvVoltage(Base): angle: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) v: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) TopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Switch.py b/pycgmes/resources/Switch.py index 1f705dda..7812570c 100644 --- a/pycgmes/resources/Switch.py +++ b/pycgmes/resources/Switch.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ConductingEquipment import ConductingEquipment -@dataclass(config=DataclassConfig) +@dataclass class Switch(ConductingEquipment): """ A generic device designed to close, or open, or both, one or more electric circuits. All switches are two terminal @@ -40,45 +39,55 @@ class Switch(ConductingEquipment): normalOpen: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratedCurrent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) retained: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # SwitchSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # SwitchSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # SvSwitch : list = Field(default_factory=list, in_profiles = [Profile.SV, ]) + # Type M:0..n in CIM + # SvSwitch : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.SV, ]}) open: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) locked: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SwitchSchedule.py b/pycgmes/resources/SwitchSchedule.py index 652551ee..3ac6f860 100644 --- a/pycgmes/resources/SwitchSchedule.py +++ b/pycgmes/resources/SwitchSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SeasonDayTypeSchedule import SeasonDayTypeSchedule -@dataclass(config=DataclassConfig) +@dataclass class SwitchSchedule(SeasonDayTypeSchedule): """ A schedule of switch positions. If RegularTimePoint.value1 is 0, the switch is open. If 1, the switch is closed. @@ -27,9 +26,11 @@ class SwitchSchedule(SeasonDayTypeSchedule): Switch: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SynchronousMachine.py b/pycgmes/resources/SynchronousMachine.py index b8997baa..d6fc7262 100644 --- a/pycgmes/resources/SynchronousMachine.py +++ b/pycgmes/resources/SynchronousMachine.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RotatingMachine import RotatingMachine -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachine(RotatingMachine): """ An electromechanical device that operates with shaft rotating synchronously with the network. It is a single machine @@ -69,161 +68,205 @@ class SynchronousMachine(RotatingMachine): InitialReactiveCapabilityCurve: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) minQ: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) qPercent: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) type: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) earthing: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) earthingStarPointR: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) earthingStarPointX: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) ikk: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) mu: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r0: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) x2: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r2: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) satDirectSubtransX: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) satDirectSyncX: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) satDirectTransX: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) shortCircuitRotorType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) voltageRegulationRange: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) operatingMode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) referencePriority: int = Field( default=0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SynchronousMachineDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # SynchronousMachineDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/SynchronousMachineDetailed.py b/pycgmes/resources/SynchronousMachineDetailed.py index e2f3126b..53104d2a 100644 --- a/pycgmes/resources/SynchronousMachineDetailed.py +++ b/pycgmes/resources/SynchronousMachineDetailed.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SynchronousMachineDynamics import SynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineDetailed(SynchronousMachineDynamics): """ All synchronous machine detailed types use a subset of the same data parameters and input/output variables. The @@ -41,30 +40,38 @@ class SynchronousMachineDetailed(SynchronousMachineDynamics): saturationFactorQAxis: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) saturationFactor120QAxis: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) efdBaseRatio: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ifdBaseType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SynchronousMachineDynamics.py b/pycgmes/resources/SynchronousMachineDynamics.py index 2ed5f5d3..48697761 100644 --- a/pycgmes/resources/SynchronousMachineDynamics.py +++ b/pycgmes/resources/SynchronousMachineDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RotatingMachineDynamics import RotatingMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineDynamics(RotatingMachineDynamics): """ Synchronous machine whose behaviour is described by reference to a standard model expressed in one of the following @@ -45,34 +44,36 @@ class SynchronousMachineDynamics(RotatingMachineDynamics): SynchronousMachine: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # CrossCompoundTurbineGovernorDyanmics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) # noqa: E501 + # Type M:0..1 in CIM + # CrossCompoundTurbineGovernorDyanmics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # CrossCompoundTurbineGovernorDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) # noqa: E501 + # Type M:0..1 in CIM + # CrossCompoundTurbineGovernorDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # MechanicalLoadDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # MechanicalLoadDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # ExcitationSystemDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # ExcitationSystemDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TurbineGovernorDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # TurbineGovernorDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # GenICompensationForGenJ : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # GenICompensationForGenJ : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/SynchronousMachineEquivalentCircuit.py b/pycgmes/resources/SynchronousMachineEquivalentCircuit.py index eb5f52ef..9a554c39 100644 --- a/pycgmes/resources/SynchronousMachineEquivalentCircuit.py +++ b/pycgmes/resources/SynchronousMachineEquivalentCircuit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SynchronousMachineDetailed import SynchronousMachineDetailed -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineEquivalentCircuit(SynchronousMachineDetailed): """ The electrical equations for all variations of the synchronous models are based on the SynchronousEquivalentCircuit @@ -53,79 +52,101 @@ class SynchronousMachineEquivalentCircuit(SynchronousMachineDetailed): xad: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rfd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xfd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r1d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) x1d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xf1d: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xaq: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r1q: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) x1q: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r2q: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) x2q: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SynchronousMachineKind.py b/pycgmes/resources/SynchronousMachineKind.py index 314a1877..b729f899 100644 --- a/pycgmes/resources/SynchronousMachineKind.py +++ b/pycgmes/resources/SynchronousMachineKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineKind(Base): """ Synchronous machine type. diff --git a/pycgmes/resources/SynchronousMachineModelKind.py b/pycgmes/resources/SynchronousMachineModelKind.py index e7d6d242..2e3760b9 100644 --- a/pycgmes/resources/SynchronousMachineModelKind.py +++ b/pycgmes/resources/SynchronousMachineModelKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineModelKind(Base): """ Type of synchronous machine model used in dynamic simulation applications. diff --git a/pycgmes/resources/SynchronousMachineOperatingMode.py b/pycgmes/resources/SynchronousMachineOperatingMode.py index 3efbd8f4..8d8bac1e 100644 --- a/pycgmes/resources/SynchronousMachineOperatingMode.py +++ b/pycgmes/resources/SynchronousMachineOperatingMode.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineOperatingMode(Base): """ Synchronous machine operating mode. diff --git a/pycgmes/resources/SynchronousMachineSimplified.py b/pycgmes/resources/SynchronousMachineSimplified.py index f39de6df..63e6004c 100644 --- a/pycgmes/resources/SynchronousMachineSimplified.py +++ b/pycgmes/resources/SynchronousMachineSimplified.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SynchronousMachineDynamics import SynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineSimplified(SynchronousMachineDynamics): """ The simplified model represents a synchronous generator as a constant internal voltage behind an impedance (Rs + diff --git a/pycgmes/resources/SynchronousMachineTimeConstantReactance.py b/pycgmes/resources/SynchronousMachineTimeConstantReactance.py index 281c1646..ccee9ce0 100644 --- a/pycgmes/resources/SynchronousMachineTimeConstantReactance.py +++ b/pycgmes/resources/SynchronousMachineTimeConstantReactance.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SynchronousMachineDetailed import SynchronousMachineDetailed -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineTimeConstantReactance(SynchronousMachineDetailed): """ Synchronous machine detailed modelling types are defined by the combination of the attributes @@ -63,100 +62,128 @@ class SynchronousMachineTimeConstantReactance(SynchronousMachineDetailed): rotorType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) modelType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ks: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xDirectSync: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xDirectTrans: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xDirectSubtrans: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xQuadSync: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xQuadTrans: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xQuadSubtrans: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpdo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tppdo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpqo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tppqo: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tc: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/SynchronousMachineUserDefined.py b/pycgmes/resources/SynchronousMachineUserDefined.py index 6e698268..3470717f 100644 --- a/pycgmes/resources/SynchronousMachineUserDefined.py +++ b/pycgmes/resources/SynchronousMachineUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SynchronousMachineDynamics import SynchronousMachineDynamics -@dataclass(config=DataclassConfig) +@dataclass class SynchronousMachineUserDefined(SynchronousMachineDynamics): """ Synchronous machine whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class SynchronousMachineUserDefined(SynchronousMachineDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TapChanger.py b/pycgmes/resources/TapChanger.py index 21c3a652..a3b7734f 100644 --- a/pycgmes/resources/TapChanger.py +++ b/pycgmes/resources/TapChanger.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class TapChanger(PowerSystemResource): """ Mechanism for changing transformer winding tap positions. @@ -50,74 +49,92 @@ class TapChanger(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TapSchedules : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # TapSchedules : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) highStep: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) lowStep: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ltcFlag: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) neutralStep: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) neutralU: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) normalStep: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) TapChangerControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvTapStep : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvTapStep : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) controlEnabled: bool = Field( default=False, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) step: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TapChangerControl.py b/pycgmes/resources/TapChangerControl.py index 61f5f746..a8a470c6 100644 --- a/pycgmes/resources/TapChangerControl.py +++ b/pycgmes/resources/TapChangerControl.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .RegulatingControl import RegulatingControl -@dataclass(config=DataclassConfig) +@dataclass class TapChangerControl(RegulatingControl): """ Describes behaviour specific to tap changers, e.g. how the voltage at the end of a line varies with the load level @@ -25,8 +24,8 @@ class TapChangerControl(RegulatingControl): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # TapChanger : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:1..n in CIM + # TapChanger : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TapChangerTablePoint.py b/pycgmes/resources/TapChangerTablePoint.py index c61cde04..92747b03 100644 --- a/pycgmes/resources/TapChangerTablePoint.py +++ b/pycgmes/resources/TapChangerTablePoint.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class TapChangerTablePoint(Base): """ Describes each tap step in the tabular curve. @@ -45,44 +44,56 @@ class TapChangerTablePoint(Base): b: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) g: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) ratio: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) step: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) x: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TapSchedule.py b/pycgmes/resources/TapSchedule.py index c715a1f1..fe371d20 100644 --- a/pycgmes/resources/TapSchedule.py +++ b/pycgmes/resources/TapSchedule.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .SeasonDayTypeSchedule import SeasonDayTypeSchedule -@dataclass(config=DataclassConfig) +@dataclass class TapSchedule(SeasonDayTypeSchedule): """ A pre-established pattern over time for a tap step. @@ -27,9 +26,11 @@ class TapSchedule(SeasonDayTypeSchedule): TapChanger: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Temperature.py b/pycgmes/resources/Temperature.py index 8ccebcd1..343a16e1 100644 --- a/pycgmes/resources/Temperature.py +++ b/pycgmes/resources/Temperature.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Temperature(Base): """ Value of temperature in degrees Celsius. @@ -29,26 +28,32 @@ class Temperature(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.DY, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Terminal.py b/pycgmes/resources/Terminal.py index cf37f55c..f5f526b3 100644 --- a/pycgmes/resources/Terminal.py +++ b/pycgmes/resources/Terminal.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ACDCTerminal import ACDCTerminal -@dataclass(config=DataclassConfig) +@dataclass class Terminal(ACDCTerminal): """ An AC electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection @@ -50,70 +49,78 @@ class Terminal(ACDCTerminal): TopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) ConductingEquipment: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + Profile.DY, + ] + }, ) ConnectivityNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ConverterDCSides : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # ConverterDCSides : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # AuxiliaryEquipment : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # AuxiliaryEquipment : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RegulatingControl : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # RegulatingControl : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 phases: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # TransformerEnd : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # TransformerEnd : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # *Association not used* - # Type M:0..2 in CIM # pylint: disable-next=line-too-long - # TieFlow : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..2 in CIM + # TieFlow : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # HasSecondMutualCoupling : list = Field(default_factory=list, in_profiles = [Profile.SC, ]) + # Type M:0..n in CIM + # HasSecondMutualCoupling : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.SC, ]}) # noqa: E501 # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # HasFirstMutualCoupling : list = Field(default_factory=list, in_profiles = [Profile.SC, ]) + # Type M:0..n in CIM + # HasFirstMutualCoupling : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.SC, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvPowerFlow : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvPowerFlow : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # RemoteInputSignal : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TextDiagramObject.py b/pycgmes/resources/TextDiagramObject.py index e59d5b97..3a488c25 100644 --- a/pycgmes/resources/TextDiagramObject.py +++ b/pycgmes/resources/TextDiagramObject.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DiagramObject import DiagramObject -@dataclass(config=DataclassConfig) +@dataclass class TextDiagramObject(DiagramObject): """ A diagram object for placing free-text or text derived from an associated domain object. @@ -26,9 +25,11 @@ class TextDiagramObject(DiagramObject): text: str = Field( default="", - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/ThermalGeneratingUnit.py b/pycgmes/resources/ThermalGeneratingUnit.py index e06a91ee..fe204544 100644 --- a/pycgmes/resources/ThermalGeneratingUnit.py +++ b/pycgmes/resources/ThermalGeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .GeneratingUnit import GeneratingUnit -@dataclass(config=DataclassConfig) +@dataclass class ThermalGeneratingUnit(GeneratingUnit): """ A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine. @@ -30,28 +29,34 @@ class ThermalGeneratingUnit(GeneratingUnit): CAESPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) CogenerationPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) CombinedCyclePlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # FossilFuels : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # FossilFuels : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TieFlow.py b/pycgmes/resources/TieFlow.py index b26f6f04..580cad92 100644 --- a/pycgmes/resources/TieFlow.py +++ b/pycgmes/resources/TieFlow.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class TieFlow(IdentifiedObject): """ Defines the structure (in terms of location and direction) of the net interchange constraint for a control area. @@ -32,23 +31,29 @@ class TieFlow(IdentifiedObject): ControlArea: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) positiveFlowIn: bool = Field( default=False, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TopologicalIsland.py b/pycgmes/resources/TopologicalIsland.py index bf4962f0..15d68d0b 100644 --- a/pycgmes/resources/TopologicalIsland.py +++ b/pycgmes/resources/TopologicalIsland.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class TopologicalIsland(IdentifiedObject): """ An electrically connected subset of the network. Topological islands can change as the current network state @@ -33,16 +32,20 @@ class TopologicalIsland(IdentifiedObject): AngleRefTopologicalNode: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) TopologicalNodes: list = Field( default_factory=list, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TopologicalNode.py b/pycgmes/resources/TopologicalNode.py index ba5b0da2..baf0483a 100644 --- a/pycgmes/resources/TopologicalNode.py +++ b/pycgmes/resources/TopologicalNode.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class TopologicalNode(IdentifiedObject): """ For a detailed substation model a topological node is a set of connectivity nodes that, in the current network @@ -44,48 +43,54 @@ class TopologicalNode(IdentifiedObject): BaseVoltage: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ConnectivityNodes : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:0..n in CIM + # ConnectivityNodes : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) # noqa: E501 ConnectivityNodeContainer: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # Terminal : list = Field(default_factory=list, in_profiles = [Profile.TP, ]) + # Type M:1..n in CIM + # Terminal : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.TP, ]}) ReportingGroup: Optional[str] = Field( default=None, - in_profiles=[ - Profile.TP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.TP, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvInjection : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvInjection : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # SvVoltage : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # SvVoltage : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # AngleRefTopologicalIsland : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # AngleRefTopologicalIsland : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # TopologicalIsland : Optional[str] = Field(default=None, in_profiles = [Profile.SV, ]) + # Type M:0..1 in CIM + # TopologicalIsland : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.SV, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TownDetail.py b/pycgmes/resources/TownDetail.py index 7f1d3bab..e90494da 100644 --- a/pycgmes/resources/TownDetail.py +++ b/pycgmes/resources/TownDetail.py @@ -12,11 +12,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class TownDetail(Base): """ Town details, in the context of address. @@ -30,37 +29,47 @@ class TownDetail(Base): code: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) section: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) name: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) stateOrProvince: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) country: str = Field( default="", - in_profiles=[ - Profile.GL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.GL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TransformerEnd.py b/pycgmes/resources/TransformerEnd.py index 1bd9ca48..d46edcc7 100644 --- a/pycgmes/resources/TransformerEnd.py +++ b/pycgmes/resources/TransformerEnd.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class TransformerEnd(IdentifiedObject): """ A conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In @@ -39,52 +38,64 @@ class TransformerEnd(IdentifiedObject): BaseVoltage: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # PhaseTapChanger : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:0..1 in CIM + # PhaseTapChanger : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # RatioTapChanger : Optional[str] = Field(default=None, in_profiles = [Profile.EQ, ]) + # Type M:0..1 in CIM + # RatioTapChanger : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 Terminal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) endNumber: int = Field( default=0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) rground: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) grounded: bool = Field( default=False, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) xground: float = Field( default=0.0, - in_profiles=[ - Profile.SC, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SC, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TurbLCFB1.py b/pycgmes/resources/TurbLCFB1.py index 28605195..b4cca129 100644 --- a/pycgmes/resources/TurbLCFB1.py +++ b/pycgmes/resources/TurbLCFB1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineLoadControllerDynamics import TurbineLoadControllerDynamics -@dataclass(config=DataclassConfig) +@dataclass class TurbLCFB1(TurbineLoadControllerDynamics): """ Turbine load controller model developed by WECC. This model represents a supervisory turbine load controller that @@ -42,86 +41,110 @@ class TurbLCFB1(TurbineLoadControllerDynamics): mwbase: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) speedReferenceGovernor: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) db: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) emax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ki: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fbf: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pbf: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpelec: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) irmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmwset: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TurbineGovernorDynamics.py b/pycgmes/resources/TurbineGovernorDynamics.py index 845ef319..8b192735 100644 --- a/pycgmes/resources/TurbineGovernorDynamics.py +++ b/pycgmes/resources/TurbineGovernorDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class TurbineGovernorDynamics(DynamicsFunctionBlock): """ Turbine-governor function block whose behaviour is described by reference to a standard model or by definition of a @@ -34,21 +33,25 @@ class TurbineGovernorDynamics(DynamicsFunctionBlock): SynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) AsynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # TurbineLoadControllerDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # TurbineLoadControllerDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TurbineGovernorUserDefined.py b/pycgmes/resources/TurbineGovernorUserDefined.py index 0367b94a..c0e5e65b 100644 --- a/pycgmes/resources/TurbineGovernorUserDefined.py +++ b/pycgmes/resources/TurbineGovernorUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineGovernorDynamics import TurbineGovernorDynamics -@dataclass(config=DataclassConfig) +@dataclass class TurbineGovernorUserDefined(TurbineGovernorDynamics): """ Turbine-governor function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class TurbineGovernorUserDefined(TurbineGovernorDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/TurbineLoadControllerDynamics.py b/pycgmes/resources/TurbineLoadControllerDynamics.py index f51ac2d2..2f3ef3dc 100644 --- a/pycgmes/resources/TurbineLoadControllerDynamics.py +++ b/pycgmes/resources/TurbineLoadControllerDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class TurbineLoadControllerDynamics(DynamicsFunctionBlock): """ Turbine load controller function block whose behaviour is described by reference to a standard model or by @@ -28,9 +27,11 @@ class TurbineLoadControllerDynamics(DynamicsFunctionBlock): TurbineGovernorDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/TurbineLoadControllerUserDefined.py b/pycgmes/resources/TurbineLoadControllerUserDefined.py index 0d912740..2bba1950 100644 --- a/pycgmes/resources/TurbineLoadControllerUserDefined.py +++ b/pycgmes/resources/TurbineLoadControllerUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .TurbineLoadControllerDynamics import TurbineLoadControllerDynamics -@dataclass(config=DataclassConfig) +@dataclass class TurbineLoadControllerUserDefined(TurbineLoadControllerDynamics): """ Turbine load controller function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class TurbineLoadControllerUserDefined(TurbineLoadControllerDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/UnderexcLim2Simplified.py b/pycgmes/resources/UnderexcLim2Simplified.py index 6abf79a1..dc2686cd 100644 --- a/pycgmes/resources/UnderexcLim2Simplified.py +++ b/pycgmes/resources/UnderexcLim2Simplified.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcLim2Simplified(UnderexcitationLimiterDynamics): """ Simplified type UEL2 underexcitation limiter. This model can be derived from UnderexcLimIEEE2. The limit @@ -34,51 +33,65 @@ class UnderexcLim2Simplified(UnderexcitationLimiterDynamics): q0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kui: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcLimIEEE1.py b/pycgmes/resources/UnderexcLimIEEE1.py index d61392b4..c4087030 100644 --- a/pycgmes/resources/UnderexcLimIEEE1.py +++ b/pycgmes/resources/UnderexcLimIEEE1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcLimIEEE1(UnderexcitationLimiterDynamics): """ Type UEL1 model which has a circular limit boundary when plotted in terms of machine reactive power vs. real power @@ -41,107 +40,137 @@ class UnderexcLimIEEE1(UnderexcitationLimiterDynamics): kur: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kuc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kuf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vurmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vucmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kui: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kul: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vulmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vulmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcLimIEEE2.py b/pycgmes/resources/UnderexcLimIEEE2.py index 29f686ca..818481c1 100644 --- a/pycgmes/resources/UnderexcLimIEEE2.py +++ b/pycgmes/resources/UnderexcLimIEEE2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcLimIEEE2(UnderexcitationLimiterDynamics): """ Type UEL2 underexcitation limiter which has either a straight-line or multi-segment characteristic when plotted in @@ -69,282 +68,362 @@ class UnderexcLimIEEE2(UnderexcitationLimiterDynamics): tuv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tup: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tuq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kui: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kul: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vuimin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kuf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kfb: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tul: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tu4: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vulmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vulmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q3: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q4: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q5: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q6: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q7: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q8: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q9: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) p10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) q10: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcLimX1.py b/pycgmes/resources/UnderexcLimX1.py index a0ba7fcf..551a87ac 100644 --- a/pycgmes/resources/UnderexcLimX1.py +++ b/pycgmes/resources/UnderexcLimX1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcLimX1(UnderexcitationLimiterDynamics): """ Allis-Chalmers minimum excitation limiter. @@ -31,44 +30,56 @@ class UnderexcLimX1(UnderexcitationLimiterDynamics): kf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) melmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) k: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcLimX2.py b/pycgmes/resources/UnderexcLimX2.py index 6a51f316..05d05cac 100644 --- a/pycgmes/resources/UnderexcLimX2.py +++ b/pycgmes/resources/UnderexcLimX2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcLimX2(UnderexcitationLimiterDynamics): """ Westinghouse minimum excitation limiter. @@ -32,51 +31,65 @@ class UnderexcLimX2(UnderexcitationLimiterDynamics): kf2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tf2: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) km: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tm: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) melmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qo: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) r: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcitationLimiterDynamics.py b/pycgmes/resources/UnderexcitationLimiterDynamics.py index 4e69252b..d516ea83 100644 --- a/pycgmes/resources/UnderexcitationLimiterDynamics.py +++ b/pycgmes/resources/UnderexcitationLimiterDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class UnderexcitationLimiterDynamics(DynamicsFunctionBlock): """ Underexcitation limiter function block whose behaviour is described by reference to a standard model or by @@ -28,14 +27,16 @@ class UnderexcitationLimiterDynamics(DynamicsFunctionBlock): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # RemoteInputSignal : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/UnderexcitationLimiterUserDefined.py b/pycgmes/resources/UnderexcitationLimiterUserDefined.py index 71a90a7a..6c3eed95 100644 --- a/pycgmes/resources/UnderexcitationLimiterUserDefined.py +++ b/pycgmes/resources/UnderexcitationLimiterUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .UnderexcitationLimiterDynamics import UnderexcitationLimiterDynamics -@dataclass(config=DataclassConfig) +@dataclass class UnderexcitationLimiterUserDefined(UnderexcitationLimiterDynamics): """ Underexcitation limiter function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class UnderexcitationLimiterUserDefined(UnderexcitationLimiterDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/UnitMultiplier.py b/pycgmes/resources/UnitMultiplier.py index e903ee11..b94d0817 100644 --- a/pycgmes/resources/UnitMultiplier.py +++ b/pycgmes/resources/UnitMultiplier.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class UnitMultiplier(Base): """ The unit multipliers defined for the CIM. When applied to unit symbols, the unit symbol is treated as a derived diff --git a/pycgmes/resources/UnitSymbol.py b/pycgmes/resources/UnitSymbol.py index 10d0bdcd..7a6b1efd 100644 --- a/pycgmes/resources/UnitSymbol.py +++ b/pycgmes/resources/UnitSymbol.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class UnitSymbol(Base): """ The derived units defined for usage in the CIM. In some cases, the derived unit is equal to an SI unit. Whenever diff --git a/pycgmes/resources/VAdjIEEE.py b/pycgmes/resources/VAdjIEEE.py index 070c2f1f..dddf4a66 100644 --- a/pycgmes/resources/VAdjIEEE.py +++ b/pycgmes/resources/VAdjIEEE.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VoltageAdjusterDynamics import VoltageAdjusterDynamics -@dataclass(config=DataclassConfig) +@dataclass class VAdjIEEE(VoltageAdjusterDynamics): """ IEEE voltage adjuster which is used to represent the voltage adjuster in either a power factor or VAr control @@ -32,44 +31,56 @@ class VAdjIEEE(VoltageAdjusterDynamics): vadjf: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) adjslew: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vadjmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) vadjmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) taon: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) taoff: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VCompIEEEType1.py b/pycgmes/resources/VCompIEEEType1.py index 101e577f..a49f4bb0 100644 --- a/pycgmes/resources/VCompIEEEType1.py +++ b/pycgmes/resources/VCompIEEEType1.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VoltageCompensatorDynamics import VoltageCompensatorDynamics -@dataclass(config=DataclassConfig) +@dataclass class VCompIEEEType1(VoltageCompensatorDynamics): """ Terminal voltage transducer and load compensator as defined in IEEE 421.5-2005, 4. This model is common to all @@ -31,23 +30,29 @@ class VCompIEEEType1(VoltageCompensatorDynamics): rc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VCompIEEEType2.py b/pycgmes/resources/VCompIEEEType2.py index 6acf4b83..824d9d84 100644 --- a/pycgmes/resources/VCompIEEEType2.py +++ b/pycgmes/resources/VCompIEEEType2.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VoltageCompensatorDynamics import VoltageCompensatorDynamics -@dataclass(config=DataclassConfig) +@dataclass class VCompIEEEType2(VoltageCompensatorDynamics): """ Terminal voltage transducer and load compensator as defined in IEEE 421.5-2005, 4. This model is designed to cover @@ -30,14 +29,16 @@ class VCompIEEEType2(VoltageCompensatorDynamics): tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:2..n in CIM # pylint: disable-next=line-too-long - # GenICompensationForGenJ : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:2..n in CIM + # GenICompensationForGenJ : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/VSCDynamics.py b/pycgmes/resources/VSCDynamics.py index bfd55b85..5667e5fe 100644 --- a/pycgmes/resources/VSCDynamics.py +++ b/pycgmes/resources/VSCDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .HVDCDynamics import HVDCDynamics -@dataclass(config=DataclassConfig) +@dataclass class VSCDynamics(HVDCDynamics): """ VSC function block whose behaviour is described by reference to a standard model or by definition of a user-defined @@ -28,9 +27,11 @@ class VSCDynamics(HVDCDynamics): VsConverter: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VSCUserDefined.py b/pycgmes/resources/VSCUserDefined.py index fd26f59e..c8ce7d38 100644 --- a/pycgmes/resources/VSCUserDefined.py +++ b/pycgmes/resources/VSCUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VSCDynamics import VSCDynamics -@dataclass(config=DataclassConfig) +@dataclass class VSCUserDefined(VSCDynamics): """ Voltage source converter (VSC) function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class VSCUserDefined(VSCDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/Validity.py b/pycgmes/resources/Validity.py index ba904ca1..e353743d 100644 --- a/pycgmes/resources/Validity.py +++ b/pycgmes/resources/Validity.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Validity(Base): """ Validity for MeasurementValue. diff --git a/pycgmes/resources/ValueAliasSet.py b/pycgmes/resources/ValueAliasSet.py index 45f605d4..ff25ac50 100644 --- a/pycgmes/resources/ValueAliasSet.py +++ b/pycgmes/resources/ValueAliasSet.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ValueAliasSet(IdentifiedObject): """ Describes the translation of a set of values into a name and is intendend to facilitate custom translations. Each @@ -31,20 +30,20 @@ class ValueAliasSet(IdentifiedObject): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Commands : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Commands : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Discretes : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # Discretes : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # RaiseLowerCommands : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:0..n in CIM + # RaiseLowerCommands : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # Values : list = Field(default_factory=list, in_profiles = [Profile.OP, ]) + # Type M:1..n in CIM + # Values : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.OP, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/ValueToAlias.py b/pycgmes/resources/ValueToAlias.py index 29adff6c..bc962d62 100644 --- a/pycgmes/resources/ValueToAlias.py +++ b/pycgmes/resources/ValueToAlias.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class ValueToAlias(IdentifiedObject): """ Describes the translation of one particular value into a name, e.g. 1 as "Open". @@ -28,16 +27,20 @@ class ValueToAlias(IdentifiedObject): ValueAliasSet: Optional[str] = Field( default=None, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) value: int = Field( default=0, - in_profiles=[ - Profile.OP, - ], + json_schema_extra={ + "in_profiles": [ + Profile.OP, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VisibilityLayer.py b/pycgmes/resources/VisibilityLayer.py index 17ecc56a..a1f5495f 100644 --- a/pycgmes/resources/VisibilityLayer.py +++ b/pycgmes/resources/VisibilityLayer.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class VisibilityLayer(IdentifiedObject): """ Layers are typically used for grouping diagram objects according to themes and scales. Themes are used to display or @@ -33,16 +32,20 @@ class VisibilityLayer(IdentifiedObject): VisibleObjects: list = Field( default_factory=list, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) drawingOrder: int = Field( default=0, - in_profiles=[ - Profile.DL, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DL, + ] + }, ) @cached_property diff --git a/pycgmes/resources/Voltage.py b/pycgmes/resources/Voltage.py index 5c30badb..c352892e 100644 --- a/pycgmes/resources/Voltage.py +++ b/pycgmes/resources/Voltage.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class Voltage(Base): """ Electrical voltage, can be both AC and DC. @@ -29,35 +28,41 @@ class Voltage(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - Profile.SC, - Profile.SV, - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + Profile.SC, + Profile.SV, + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VoltageAdjusterDynamics.py b/pycgmes/resources/VoltageAdjusterDynamics.py index 51a8a2b8..00594e2b 100644 --- a/pycgmes/resources/VoltageAdjusterDynamics.py +++ b/pycgmes/resources/VoltageAdjusterDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class VoltageAdjusterDynamics(DynamicsFunctionBlock): """ Voltage adjuster function block whose behaviour is described by reference to a standard model or by definition of a @@ -29,9 +28,11 @@ class VoltageAdjusterDynamics(DynamicsFunctionBlock): PFVArControllerType1Dynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VoltageAdjusterUserDefined.py b/pycgmes/resources/VoltageAdjusterUserDefined.py index 700d2f93..a471a234 100644 --- a/pycgmes/resources/VoltageAdjusterUserDefined.py +++ b/pycgmes/resources/VoltageAdjusterUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VoltageAdjusterDynamics import VoltageAdjusterDynamics -@dataclass(config=DataclassConfig) +@dataclass class VoltageAdjusterUserDefined(VoltageAdjusterDynamics): """ Voltage adjuster function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class VoltageAdjusterUserDefined(VoltageAdjusterDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/VoltageCompensatorDynamics.py b/pycgmes/resources/VoltageCompensatorDynamics.py index 91e28e6d..ed25df0a 100644 --- a/pycgmes/resources/VoltageCompensatorDynamics.py +++ b/pycgmes/resources/VoltageCompensatorDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class VoltageCompensatorDynamics(DynamicsFunctionBlock): """ Voltage compensator function block whose behaviour is described by reference to a standard model or by definition of @@ -28,14 +27,16 @@ class VoltageCompensatorDynamics(DynamicsFunctionBlock): """ # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # RemoteInputSignal : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # RemoteInputSignal : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 ExcitationSystemDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VoltageCompensatorUserDefined.py b/pycgmes/resources/VoltageCompensatorUserDefined.py index 754f6ada..c568c144 100644 --- a/pycgmes/resources/VoltageCompensatorUserDefined.py +++ b/pycgmes/resources/VoltageCompensatorUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .VoltageCompensatorDynamics import VoltageCompensatorDynamics -@dataclass(config=DataclassConfig) +@dataclass class VoltageCompensatorUserDefined(VoltageCompensatorDynamics): """ Voltage compensator function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class VoltageCompensatorUserDefined(VoltageCompensatorDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/VoltageLevel.py b/pycgmes/resources/VoltageLevel.py index 166f9049..73843384 100644 --- a/pycgmes/resources/VoltageLevel.py +++ b/pycgmes/resources/VoltageLevel.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .EquipmentContainer import EquipmentContainer -@dataclass(config=DataclassConfig) +@dataclass class VoltageLevel(EquipmentContainer): """ A collection of equipment at one common system voltage forming a switchgear. The equipment typically consists of @@ -37,38 +36,46 @@ class VoltageLevel(EquipmentContainer): BaseVoltage: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # Bays : list = Field(default_factory=list, in_profiles = [Profile.EQBD, Profile.EQ, ]) + # Type M:0..n in CIM + # Bays : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQBD, Profile.EQ, ]}) # noqa: E501 Substation: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) highVoltageLimit: float = Field( default=0.0, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) lowVoltageLimit: float = Field( default=0.0, - in_profiles=[ - Profile.EQBD, - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQBD, + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VoltageLimit.py b/pycgmes/resources/VoltageLimit.py index 6dc0bfb6..e9c167bb 100644 --- a/pycgmes/resources/VoltageLimit.py +++ b/pycgmes/resources/VoltageLimit.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .OperationalLimit import OperationalLimit -@dataclass(config=DataclassConfig) +@dataclass class VoltageLimit(OperationalLimit): """ Operational limit applied to voltage. The use of operational VoltageLimit is preferred instead of limits defined at @@ -30,16 +29,20 @@ class VoltageLimit(OperationalLimit): normalValue: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VoltagePerReactivePower.py b/pycgmes/resources/VoltagePerReactivePower.py index 96799a7c..60f25c36 100644 --- a/pycgmes/resources/VoltagePerReactivePower.py +++ b/pycgmes/resources/VoltagePerReactivePower.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class VoltagePerReactivePower(Base): """ Voltage variation with reactive power. @@ -29,23 +28,29 @@ class VoltagePerReactivePower(Base): value: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VolumeFlowRate.py b/pycgmes/resources/VolumeFlowRate.py index 97f9dbd2..0973f8ad 100644 --- a/pycgmes/resources/VolumeFlowRate.py +++ b/pycgmes/resources/VolumeFlowRate.py @@ -13,11 +13,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class VolumeFlowRate(Base): """ Volume per time. @@ -29,23 +28,29 @@ class VolumeFlowRate(Base): multiplier: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) unit: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) value: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/VsCapabilityCurve.py b/pycgmes/resources/VsCapabilityCurve.py index 60f8c82a..043a4b68 100644 --- a/pycgmes/resources/VsCapabilityCurve.py +++ b/pycgmes/resources/VsCapabilityCurve.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Curve import Curve -@dataclass(config=DataclassConfig) +@dataclass class VsCapabilityCurve(Curve): """ The P-Q capability curve for a voltage source converter, with P on X-axis and Qmin and Qmax on Y1-axis and Y2-axis. @@ -24,8 +23,8 @@ class VsCapabilityCurve(Curve): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # VsConverterDCSides : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # VsConverterDCSides : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/VsConverter.py b/pycgmes/resources/VsConverter.py index 9ad8f855..eddc606a 100644 --- a/pycgmes/resources/VsConverter.py +++ b/pycgmes/resources/VsConverter.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .ACDCConverter import ACDCConverter -@dataclass(config=DataclassConfig) +@dataclass class VsConverter(ACDCConverter): """ DC side of the voltage source converter (VSC). @@ -48,105 +47,133 @@ class VsConverter(ACDCConverter): CapabilityCurve: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) maxModulationIndex: float = Field( default=0.0, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) delta: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) uv: float = Field( default=0.0, - in_profiles=[ - Profile.SV, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SV, + ] + }, ) droop: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) droopCompensation: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) pPccControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) qPccControl: Optional[str] = Field( default=None, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) qShare: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetQpcc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetUpcc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetPowerFactorPcc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetPhasePcc: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) targetPWMfactor: float = Field( default=0.0, - in_profiles=[ - Profile.SSH, - ], + json_schema_extra={ + "in_profiles": [ + Profile.SSH, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # VSCDynamics : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # VSCDynamics : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/VsPpccControlKind.py b/pycgmes/resources/VsPpccControlKind.py index 1ffbc082..232bb97b 100644 --- a/pycgmes/resources/VsPpccControlKind.py +++ b/pycgmes/resources/VsPpccControlKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class VsPpccControlKind(Base): """ Types applicable to the control of real power and/or DC voltage by voltage source converter. diff --git a/pycgmes/resources/VsQpccControlKind.py b/pycgmes/resources/VsQpccControlKind.py index 1070719c..6398ecaf 100644 --- a/pycgmes/resources/VsQpccControlKind.py +++ b/pycgmes/resources/VsQpccControlKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class VsQpccControlKind(Base): """ Kind of reactive power control at point of common coupling for a voltage source converter. diff --git a/pycgmes/resources/WaveTrap.py b/pycgmes/resources/WaveTrap.py index 790be982..b359d849 100644 --- a/pycgmes/resources/WaveTrap.py +++ b/pycgmes/resources/WaveTrap.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .AuxiliaryEquipment import AuxiliaryEquipment -@dataclass(config=DataclassConfig) +@dataclass class WaveTrap(AuxiliaryEquipment): """ Line traps are devices that impede high frequency power line carrier signals yet present a negligible impedance at diff --git a/pycgmes/resources/WindAeroConstIEC.py b/pycgmes/resources/WindAeroConstIEC.py index 10ba02bb..9dabe495 100644 --- a/pycgmes/resources/WindAeroConstIEC.py +++ b/pycgmes/resources/WindAeroConstIEC.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindAeroConstIEC(IdentifiedObject): """ Constant aerodynamic torque model which assumes that the aerodynamic torque is constant. Reference: IEC @@ -25,8 +24,8 @@ class WindAeroConstIEC(IdentifiedObject): """ # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindGenTurbineType1aIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindGenTurbineType1aIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindAeroOneDimIEC.py b/pycgmes/resources/WindAeroOneDimIEC.py index 2cfb8254..a92cd745 100644 --- a/pycgmes/resources/WindAeroOneDimIEC.py +++ b/pycgmes/resources/WindAeroOneDimIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindAeroOneDimIEC(IdentifiedObject): """ One-dimensional aerodynamic model. Reference: IEC 61400-27-1:2015, 5.6.1.2. @@ -28,21 +27,25 @@ class WindAeroOneDimIEC(IdentifiedObject): ka: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetaomega: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindAeroTwoDimIEC.py b/pycgmes/resources/WindAeroTwoDimIEC.py index d26cdcc5..c3686adf 100644 --- a/pycgmes/resources/WindAeroTwoDimIEC.py +++ b/pycgmes/resources/WindAeroTwoDimIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindAeroTwoDimIEC(IdentifiedObject): """ Two-dimensional aerodynamic model. Reference: IEC 61400-27-1:2015, 5.6.1.3. @@ -35,56 +34,70 @@ class WindAeroTwoDimIEC(IdentifiedObject): dpomega: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dptheta: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpv1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omegazero: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pavail: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetazero: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetav2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContCurrLimIEC.py b/pycgmes/resources/WindContCurrLimIEC.py index d6a217a3..bc98bed5 100644 --- a/pycgmes/resources/WindContCurrLimIEC.py +++ b/pycgmes/resources/WindContCurrLimIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContCurrLimIEC(IdentifiedObject): """ Current limitation model. The current limitation model combines the physical limits and the control limits. @@ -41,60 +40,74 @@ class WindContCurrLimIEC(IdentifiedObject): imax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) imaxdip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpqu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mdfslim: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mqpri: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltcl: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) upqumax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContPType3IEC.py b/pycgmes/resources/WindContPType3IEC.py index 7d62b360..53decb36 100644 --- a/pycgmes/resources/WindContPType3IEC.py +++ b/pycgmes/resources/WindContPType3IEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContPType3IEC(IdentifiedObject): """ P control model type 3. Reference: IEC 61400-27-1:2015, 5.6.5.4. @@ -55,172 +54,218 @@ class WindContPType3IEC(IdentifiedObject): dpmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dprefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dprefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dthetamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dthetamaxuvrt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdtd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mpuvrt: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omegaoffset: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pdtdmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tdvs: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetaemin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetauscale: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tomegafiltp3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpfiltp3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpord: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltp3: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tomegaref: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) udvs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) updip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) omegadtd: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) zeta: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContPType4aIEC.py b/pycgmes/resources/WindContPType4aIEC.py index 8c46b248..931db2ac 100644 --- a/pycgmes/resources/WindContPType4aIEC.py +++ b/pycgmes/resources/WindContPType4aIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContPType4aIEC(IdentifiedObject): """ P control model type 4A. Reference: IEC 61400-27-1:2015, 5.6.5.5. @@ -29,28 +28,34 @@ class WindContPType4aIEC(IdentifiedObject): dpmaxp4a: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpordp4a: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltp4a: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4aIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType4aIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContPType4bIEC.py b/pycgmes/resources/WindContPType4bIEC.py index 887a7334..8175e086 100644 --- a/pycgmes/resources/WindContPType4bIEC.py +++ b/pycgmes/resources/WindContPType4bIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContPType4bIEC(IdentifiedObject): """ P control model type 4B. Reference: IEC 61400-27-1:2015, 5.6.5.6. @@ -30,35 +29,43 @@ class WindContPType4bIEC(IdentifiedObject): dpmaxp4b: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpaero: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpordp4b: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltp4b: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4bIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType4bIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContPitchAngleIEC.py b/pycgmes/resources/WindContPitchAngleIEC.py index 2fa72a8a..c39afb25 100644 --- a/pycgmes/resources/WindContPitchAngleIEC.py +++ b/pycgmes/resources/WindContPitchAngleIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContPitchAngleIEC(IdentifiedObject): """ Pitch angle control model. Reference: IEC 61400-27-1:2015, 5.6.5.2. @@ -38,77 +37,97 @@ class WindContPitchAngleIEC(IdentifiedObject): dthetamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dthetamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kic: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiomega: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpomega: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetamax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) thetamin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) ttheta: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContQIEC.py b/pycgmes/resources/WindContQIEC.py index f360f66c..fb9992f9 100644 --- a/pycgmes/resources/WindContQIEC.py +++ b/pycgmes/resources/WindContQIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContQIEC(IdentifiedObject): """ Q control model. Reference: IEC 61400-27-1:2015, 5.6.5.7. @@ -53,168 +52,214 @@ class WindContQIEC(IdentifiedObject): iqh1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iqmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iqmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) iqpost: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiq: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpq: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kqv: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpfiltq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rdroop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpost: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tqord: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) udb1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) udb2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) umax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) umin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uqdip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uref0: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) windQcontrolModesType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) windUVRTQcontrolModesType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xdroop: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContQLimIEC.py b/pycgmes/resources/WindContQLimIEC.py index 5f400ea5..bd9956d9 100644 --- a/pycgmes/resources/WindContQLimIEC.py +++ b/pycgmes/resources/WindContQLimIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContQLimIEC(IdentifiedObject): """ Constant Q limitation model. Reference: IEC 61400-27-1:2015, 5.6.5.9. @@ -29,21 +28,25 @@ class WindContQLimIEC(IdentifiedObject): qmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) qmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContQPQULimIEC.py b/pycgmes/resources/WindContQPQULimIEC.py index 7a740f78..afe7a293 100644 --- a/pycgmes/resources/WindContQPQULimIEC.py +++ b/pycgmes/resources/WindContQPQULimIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContQPQULimIEC(IdentifiedObject): """ QP and QU limitation model. Reference: IEC 61400-27-1:2015, 5.6.5.10. @@ -31,25 +30,29 @@ class WindContQPQULimIEC(IdentifiedObject): tpfiltql: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tufiltql: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindContRotorRIEC.py b/pycgmes/resources/WindContRotorRIEC.py index 1ddc8e47..2c118d1a 100644 --- a/pycgmes/resources/WindContRotorRIEC.py +++ b/pycgmes/resources/WindContRotorRIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindContRotorRIEC(IdentifiedObject): """ Rotor resistance control model. Reference: IEC 61400-27-1:2015, 5.6.5.3. @@ -37,67 +36,83 @@ class WindContRotorRIEC(IdentifiedObject): kirr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) komegafilt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpfilt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kprr: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) rmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tomegafiltrr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpfiltrr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindGenTurbineType2IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindGenTurbineType2IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindDynamicsLookupTable.py b/pycgmes/resources/WindDynamicsLookupTable.py index 101a6175..8c57ca61 100644 --- a/pycgmes/resources/WindDynamicsLookupTable.py +++ b/pycgmes/resources/WindDynamicsLookupTable.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindDynamicsLookupTable(IdentifiedObject): """ Look up table for the purpose of wind standard models. @@ -41,93 +40,119 @@ class WindDynamicsLookupTable(IdentifiedObject): WindContCurrLimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContPType3IEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContQPQULimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContRotorRIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) input: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) lookupTableFunctionType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) output: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) sequence: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPlantFreqPcontrolIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindProtectionIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPlantReactiveControlIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindGenType3bIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPitchContPowerIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindGenTurbineType1aIEC.py b/pycgmes/resources/WindGenTurbineType1aIEC.py index e01006e7..47830b31 100644 --- a/pycgmes/resources/WindGenTurbineType1aIEC.py +++ b/pycgmes/resources/WindGenTurbineType1aIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType1or2IEC import WindTurbineType1or2IEC -@dataclass(config=DataclassConfig) +@dataclass class WindGenTurbineType1aIEC(WindTurbineType1or2IEC): """ Wind turbine IEC type 1A. Reference: IEC 61400-27-1:2015, 5.5.2.2. @@ -27,9 +26,11 @@ class WindGenTurbineType1aIEC(WindTurbineType1or2IEC): WindAeroConstIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindGenTurbineType1bIEC.py b/pycgmes/resources/WindGenTurbineType1bIEC.py index 4b35365f..6928f585 100644 --- a/pycgmes/resources/WindGenTurbineType1bIEC.py +++ b/pycgmes/resources/WindGenTurbineType1bIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType1or2IEC import WindTurbineType1or2IEC -@dataclass(config=DataclassConfig) +@dataclass class WindGenTurbineType1bIEC(WindTurbineType1or2IEC): """ Wind turbine IEC type 1B. Reference: IEC 61400-27-1:2015, 5.5.2.3. @@ -27,9 +26,11 @@ class WindGenTurbineType1bIEC(WindTurbineType1or2IEC): WindPitchContPowerIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindGenTurbineType2IEC.py b/pycgmes/resources/WindGenTurbineType2IEC.py index 564e6c10..4dfc4323 100644 --- a/pycgmes/resources/WindGenTurbineType2IEC.py +++ b/pycgmes/resources/WindGenTurbineType2IEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType1or2IEC import WindTurbineType1or2IEC -@dataclass(config=DataclassConfig) +@dataclass class WindGenTurbineType2IEC(WindTurbineType1or2IEC): """ Wind turbine IEC type 2. Reference: IEC 61400-27-1:2015, 5.5.3. @@ -28,16 +27,20 @@ class WindGenTurbineType2IEC(WindTurbineType1or2IEC): WindContRotorRIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPitchContPowerIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindGenType3IEC.py b/pycgmes/resources/WindGenType3IEC.py index 142cedf5..1ffda3db 100644 --- a/pycgmes/resources/WindGenType3IEC.py +++ b/pycgmes/resources/WindGenType3IEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindGenType3IEC(IdentifiedObject): """ Parent class supporting relationships to IEC wind turbines type 3 generator models of IEC type 3A and 3B. @@ -29,28 +28,34 @@ class WindGenType3IEC(IdentifiedObject): dipmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) diqmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xs: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindGenType3aIEC.py b/pycgmes/resources/WindGenType3aIEC.py index 53064888..43cd205f 100644 --- a/pycgmes/resources/WindGenType3aIEC.py +++ b/pycgmes/resources/WindGenType3aIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindGenType3IEC import WindGenType3IEC -@dataclass(config=DataclassConfig) +@dataclass class WindGenType3aIEC(WindGenType3IEC): """ IEC type 3A generator set model. Reference: IEC 61400-27-1:2015, 5.6.3.2. @@ -28,21 +27,25 @@ class WindGenType3aIEC(WindGenType3IEC): kpc: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tic: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindGenType3bIEC.py b/pycgmes/resources/WindGenType3bIEC.py index 99fba148..a5664f63 100644 --- a/pycgmes/resources/WindGenType3bIEC.py +++ b/pycgmes/resources/WindGenType3bIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindGenType3IEC import WindGenType3IEC -@dataclass(config=DataclassConfig) +@dataclass class WindGenType3bIEC(WindGenType3IEC): """ IEC type 3B generator set model. Reference: IEC 61400-27-1:2015, 5.6.3.3. @@ -29,28 +28,34 @@ class WindGenType3bIEC(WindGenType3IEC): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 mwtcwp: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) two: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindGenType4IEC.py b/pycgmes/resources/WindGenType4IEC.py index 17a037af..10f939f2 100644 --- a/pycgmes/resources/WindGenType4IEC.py +++ b/pycgmes/resources/WindGenType4IEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindGenType4IEC(IdentifiedObject): """ IEC type 4 generator set model. Reference: IEC 61400-27-1:2015, 5.6.3.4. @@ -31,39 +30,47 @@ class WindGenType4IEC(IdentifiedObject): dipmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) diqmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) diqmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tg: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4aIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType4aIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4bIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType4bIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindGenUnitKind.py b/pycgmes/resources/WindGenUnitKind.py index cc98a286..017ea589 100644 --- a/pycgmes/resources/WindGenUnitKind.py +++ b/pycgmes/resources/WindGenUnitKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindGenUnitKind(Base): """ Kind of wind generating unit. diff --git a/pycgmes/resources/WindGeneratingUnit.py b/pycgmes/resources/WindGeneratingUnit.py index 93f1517c..620a2f93 100644 --- a/pycgmes/resources/WindGeneratingUnit.py +++ b/pycgmes/resources/WindGeneratingUnit.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .GeneratingUnit import GeneratingUnit -@dataclass(config=DataclassConfig) +@dataclass class WindGeneratingUnit(GeneratingUnit): """ A wind driven generating unit, connected to the grid by means of a rotating machine. May be used to represent a @@ -29,16 +28,20 @@ class WindGeneratingUnit(GeneratingUnit): windGenUnitType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) WindPowerPlant: Optional[str] = Field( default=None, - in_profiles=[ - Profile.EQ, - ], + json_schema_extra={ + "in_profiles": [ + Profile.EQ, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindLookupTableFunctionKind.py b/pycgmes/resources/WindLookupTableFunctionKind.py index 40384bd7..3747442a 100644 --- a/pycgmes/resources/WindLookupTableFunctionKind.py +++ b/pycgmes/resources/WindLookupTableFunctionKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindLookupTableFunctionKind(Base): """ Function of the lookup table. diff --git a/pycgmes/resources/WindMechIEC.py b/pycgmes/resources/WindMechIEC.py index 8d83df82..ae5db491 100644 --- a/pycgmes/resources/WindMechIEC.py +++ b/pycgmes/resources/WindMechIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindMechIEC(IdentifiedObject): """ Two mass model. Reference: IEC 61400-27-1:2015, 5.6.2.1. @@ -32,43 +31,51 @@ class WindMechIEC(IdentifiedObject): cdrt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hgen: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) hwtr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kdrt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType1or2IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType1or2IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType4bIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType4bIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindPitchContPowerIEC.py b/pycgmes/resources/WindPitchContPowerIEC.py index 5930ba82..76b8cd48 100644 --- a/pycgmes/resources/WindPitchContPowerIEC.py +++ b/pycgmes/resources/WindPitchContPowerIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindPitchContPowerIEC(IdentifiedObject): """ Pitch control power model. Reference: IEC 61400-27-1:2015, 5.6.5.1. @@ -35,64 +34,78 @@ class WindPitchContPowerIEC(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindGenTurbineType1bIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindGenTurbineType1bIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindGenTurbineType2IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindGenTurbineType2IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 dpmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) pset: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) t1: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tr: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uuvrt: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindPlantDynamics.py b/pycgmes/resources/WindPlantDynamics.py index c4748314..9629dbc7 100644 --- a/pycgmes/resources/WindPlantDynamics.py +++ b/pycgmes/resources/WindPlantDynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class WindPlantDynamics(DynamicsFunctionBlock): """ Parent class supporting relationships to wind turbines type 3 and type 4 and wind plant IEC and user-defined wind @@ -29,14 +28,16 @@ class WindPlantDynamics(DynamicsFunctionBlock): RemoteInputSignal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4Dynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindTurbineType3or4Dynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindPlantFreqPcontrolIEC.py b/pycgmes/resources/WindPlantFreqPcontrolIEC.py index f85abbf8..04d0ca09 100644 --- a/pycgmes/resources/WindPlantFreqPcontrolIEC.py +++ b/pycgmes/resources/WindPlantFreqPcontrolIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindPlantFreqPcontrolIEC(IdentifiedObject): """ Frequency and active power controller model. Reference: IEC 61400-27-1:2015, Annex D. @@ -51,117 +50,147 @@ class WindPlantFreqPcontrolIEC(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 dprefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dprefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpwprefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dpwprefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) prefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) prefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwppmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwppmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpwpp: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kwppref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpft: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tpfv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twpffiltp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twppfiltp: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindPlantIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindPlantIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindPlantIEC.py b/pycgmes/resources/WindPlantIEC.py index 3031abd7..1ceb1681 100644 --- a/pycgmes/resources/WindPlantIEC.py +++ b/pycgmes/resources/WindPlantIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindPlantDynamics import WindPlantDynamics -@dataclass(config=DataclassConfig) +@dataclass class WindPlantIEC(WindPlantDynamics): """ Simplified IEC type plant level model. Reference: IEC 61400-27-1:2015, Annex D. @@ -28,16 +27,20 @@ class WindPlantIEC(WindPlantDynamics): WindPlantFreqPcontrolIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPlantReactiveControlIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindPlantQcontrolModeKind.py b/pycgmes/resources/WindPlantQcontrolModeKind.py index 8b09118c..4e73267d 100644 --- a/pycgmes/resources/WindPlantQcontrolModeKind.py +++ b/pycgmes/resources/WindPlantQcontrolModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindPlantQcontrolModeKind(Base): """ Reactive power/voltage controller mode. diff --git a/pycgmes/resources/WindPlantReactiveControlIEC.py b/pycgmes/resources/WindPlantReactiveControlIEC.py index d5a9d6b5..2bd226da 100644 --- a/pycgmes/resources/WindPlantReactiveControlIEC.py +++ b/pycgmes/resources/WindPlantReactiveControlIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindPlantReactiveControlIEC(IdentifiedObject): """ Simplified plant voltage and reactive power control model for use with type 3 and type 4 wind turbine models. @@ -56,137 +55,173 @@ class WindPlantReactiveControlIEC(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindPlantIEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindPlantIEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) dxrefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) dxrefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwpx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwpxmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kiwpxmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kpwpx: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kwpqref: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) kwpqu: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tuqfilt: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twppfiltq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twpqfiltq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) twpufiltq: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) txft: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) txfv: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uwpqdip: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) windPlantQcontrolModesType: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xrefmax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) xrefmin: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindPlantUserDefined.py b/pycgmes/resources/WindPlantUserDefined.py index 27246c2a..77101275 100644 --- a/pycgmes/resources/WindPlantUserDefined.py +++ b/pycgmes/resources/WindPlantUserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindPlantDynamics import WindPlantDynamics -@dataclass(config=DataclassConfig) +@dataclass class WindPlantUserDefined(WindPlantDynamics): """ Wind plant function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class WindPlantUserDefined(WindPlantDynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindPowerPlant.py b/pycgmes/resources/WindPowerPlant.py index fa47d6f1..f837ac59 100644 --- a/pycgmes/resources/WindPowerPlant.py +++ b/pycgmes/resources/WindPowerPlant.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .PowerSystemResource import PowerSystemResource -@dataclass(config=DataclassConfig) +@dataclass class WindPowerPlant(PowerSystemResource): """ Wind power plant. @@ -24,8 +23,8 @@ class WindPowerPlant(PowerSystemResource): """ # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # WindGeneratingUnits : list = Field(default_factory=list, in_profiles = [Profile.EQ, ]) + # Type M:0..n in CIM + # WindGeneratingUnits : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.EQ, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindProtectionIEC.py b/pycgmes/resources/WindProtectionIEC.py index 650ec6e0..4d4c8305 100644 --- a/pycgmes/resources/WindProtectionIEC.py +++ b/pycgmes/resources/WindProtectionIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindProtectionIEC(IdentifiedObject): """ The grid protection model includes protection against over- and under-voltage, and against over- and under- @@ -39,65 +38,79 @@ class WindProtectionIEC(IdentifiedObject): """ # *Association not used* - # Type M:1..n in CIM # pylint: disable-next=line-too-long - # WindDynamicsLookupTable : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:1..n in CIM + # WindDynamicsLookupTable : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 dfimax: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) fover: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) funder: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) mzc: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) tfma: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uover: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) uunder: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 # *Association not used* - # Type M:0..1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType1or2IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:0..1 in CIM + # WindTurbineType1or2IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindQcontrolModeKind.py b/pycgmes/resources/WindQcontrolModeKind.py index 5423bcd7..94648998 100644 --- a/pycgmes/resources/WindQcontrolModeKind.py +++ b/pycgmes/resources/WindQcontrolModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindQcontrolModeKind(Base): """ General wind turbine Q control modes MqG. diff --git a/pycgmes/resources/WindRefFrameRotIEC.py b/pycgmes/resources/WindRefFrameRotIEC.py index b433e89d..bab2666e 100644 --- a/pycgmes/resources/WindRefFrameRotIEC.py +++ b/pycgmes/resources/WindRefFrameRotIEC.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .IdentifiedObject import IdentifiedObject -@dataclass(config=DataclassConfig) +@dataclass class WindRefFrameRotIEC(IdentifiedObject): """ Reference frame rotation model. Reference: IEC 61400-27-1:2015, 5.6.3.5. @@ -32,28 +31,34 @@ class WindRefFrameRotIEC(IdentifiedObject): tpll: int = Field( default=0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) upll1: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) upll2: float = Field( default=0.0, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:1 in CIM # pylint: disable-next=line-too-long - # WindTurbineType3or4IEC : Optional[str] = Field(default=None, in_profiles = [Profile.DY, ]) + # Type M:1 in CIM + # WindTurbineType3or4IEC : Optional[str] = Field(default=None, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindTurbineType1or2Dynamics.py b/pycgmes/resources/WindTurbineType1or2Dynamics.py index d968c766..d9faf79f 100644 --- a/pycgmes/resources/WindTurbineType1or2Dynamics.py +++ b/pycgmes/resources/WindTurbineType1or2Dynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType1or2Dynamics(DynamicsFunctionBlock): """ Parent class supporting relationships to wind turbines type 1 and type 2 and their control models. Generator model @@ -30,16 +29,20 @@ class WindTurbineType1or2Dynamics(DynamicsFunctionBlock): RemoteInputSignal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) AsynchronousMachineDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType1or2IEC.py b/pycgmes/resources/WindTurbineType1or2IEC.py index 13fb1a06..4844872f 100644 --- a/pycgmes/resources/WindTurbineType1or2IEC.py +++ b/pycgmes/resources/WindTurbineType1or2IEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType1or2Dynamics import WindTurbineType1or2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType1or2IEC(WindTurbineType1or2Dynamics): """ Parent class supporting relationships to IEC wind turbines type 1 and type 2 including their control models. @@ -30,16 +29,20 @@ class WindTurbineType1or2IEC(WindTurbineType1or2Dynamics): WindMechIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindProtectionIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType3IEC.py b/pycgmes/resources/WindTurbineType3IEC.py index 5cda2161..559eb042 100644 --- a/pycgmes/resources/WindTurbineType3IEC.py +++ b/pycgmes/resources/WindTurbineType3IEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType3or4IEC import WindTurbineType3or4IEC -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType3IEC(WindTurbineType3or4IEC): """ Parent class supporting relationships to IEC wind turbines type 3 including their control models. @@ -32,44 +31,56 @@ class WindTurbineType3IEC(WindTurbineType3or4IEC): WindAeroOneDimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindAeroTwoDimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContPitchAngleIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContPType3IEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindGenType3IEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindMechIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType3or4Dynamics.py b/pycgmes/resources/WindTurbineType3or4Dynamics.py index 013f2b87..bc9e1b34 100644 --- a/pycgmes/resources/WindTurbineType3or4Dynamics.py +++ b/pycgmes/resources/WindTurbineType3or4Dynamics.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .DynamicsFunctionBlock import DynamicsFunctionBlock -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType3or4Dynamics(DynamicsFunctionBlock): """ Parent class supporting relationships to wind turbines type 3 and type 4 and wind plant including their control @@ -31,23 +30,29 @@ class WindTurbineType3or4Dynamics(DynamicsFunctionBlock): PowerElectronicsConnection: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) RemoteInputSignal: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindPlantDynamics: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType3or4IEC.py b/pycgmes/resources/WindTurbineType3or4IEC.py index 68cc2ddb..682eac46 100644 --- a/pycgmes/resources/WindTurbineType3or4IEC.py +++ b/pycgmes/resources/WindTurbineType3or4IEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType3or4Dynamics import WindTurbineType3or4Dynamics -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType3or4IEC(WindTurbineType3or4Dynamics): """ Parent class supporting relationships to IEC wind turbines type 3 and type 4 including their control models. @@ -32,44 +31,56 @@ class WindTurbineType3or4IEC(WindTurbineType3or4Dynamics): WindContCurrLimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WIndContQIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContQLimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindContQPQULimIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindProtectionIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindRefFrameRotIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType4IEC.py b/pycgmes/resources/WindTurbineType4IEC.py index b36eb869..2cdd4041 100644 --- a/pycgmes/resources/WindTurbineType4IEC.py +++ b/pycgmes/resources/WindTurbineType4IEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType3or4IEC import WindTurbineType3or4IEC -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType4IEC(WindTurbineType3or4IEC): """ Parent class supporting relationships to IEC wind turbines type 4 including their control models. @@ -27,9 +26,11 @@ class WindTurbineType4IEC(WindTurbineType3or4IEC): WindGenType3aIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType4aIEC.py b/pycgmes/resources/WindTurbineType4aIEC.py index af2d72a5..23b6035c 100644 --- a/pycgmes/resources/WindTurbineType4aIEC.py +++ b/pycgmes/resources/WindTurbineType4aIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType4IEC import WindTurbineType4IEC -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType4aIEC(WindTurbineType4IEC): """ Wind turbine IEC type 4A. Reference: IEC 61400-27-1:2015, 5.5.5.2. @@ -28,16 +27,20 @@ class WindTurbineType4aIEC(WindTurbineType4IEC): WindContPType4aIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindGenType4IEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindTurbineType4bIEC.py b/pycgmes/resources/WindTurbineType4bIEC.py index 09ec8959..235cd02c 100644 --- a/pycgmes/resources/WindTurbineType4bIEC.py +++ b/pycgmes/resources/WindTurbineType4bIEC.py @@ -12,12 +12,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType4IEC import WindTurbineType4IEC -@dataclass(config=DataclassConfig) +@dataclass class WindTurbineType4bIEC(WindTurbineType4IEC): """ Wind turbine IEC type 4B. Reference: IEC 61400-27-1:2015, 5.5.5.3. @@ -29,23 +28,29 @@ class WindTurbineType4bIEC(WindTurbineType4IEC): WindContPType4bIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindGenType4IEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) WindMechIEC: Optional[str] = Field( default=None, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) @cached_property diff --git a/pycgmes/resources/WindType1or2UserDefined.py b/pycgmes/resources/WindType1or2UserDefined.py index 3f33c668..c082f84a 100644 --- a/pycgmes/resources/WindType1or2UserDefined.py +++ b/pycgmes/resources/WindType1or2UserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType1or2Dynamics import WindTurbineType1or2Dynamics -@dataclass(config=DataclassConfig) +@dataclass class WindType1or2UserDefined(WindTurbineType1or2Dynamics): """ Wind type 1 or type 2 function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class WindType1or2UserDefined(WindTurbineType1or2Dynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindType3or4UserDefined.py b/pycgmes/resources/WindType3or4UserDefined.py index d96d5168..8e0f99f0 100644 --- a/pycgmes/resources/WindType3or4UserDefined.py +++ b/pycgmes/resources/WindType3or4UserDefined.py @@ -11,12 +11,11 @@ from pydantic import Field from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .WindTurbineType3or4Dynamics import WindTurbineType3or4Dynamics -@dataclass(config=DataclassConfig) +@dataclass class WindType3or4UserDefined(WindTurbineType3or4Dynamics): """ Wind type 3 or type 4 function block whose dynamic behaviour is described by a user-defined model. @@ -30,14 +29,16 @@ class WindType3or4UserDefined(WindTurbineType3or4Dynamics): proprietary: bool = Field( default=False, - in_profiles=[ - Profile.DY, - ], + json_schema_extra={ + "in_profiles": [ + Profile.DY, + ] + }, ) # *Association not used* - # Type M:0..n in CIM # pylint: disable-next=line-too-long - # ProprietaryParameterDynamics : list = Field(default_factory=list, in_profiles = [Profile.DY, ]) + # Type M:0..n in CIM + # ProprietaryParameterDynamics : list = Field(default_factory=list, json_schema_extra={"in_profiles":[Profile.DY, ]}) # noqa: E501 @cached_property def possible_profiles(self) -> set[BaseProfile]: diff --git a/pycgmes/resources/WindUVRTQcontrolModeKind.py b/pycgmes/resources/WindUVRTQcontrolModeKind.py index e823b3e6..0cb4eaeb 100644 --- a/pycgmes/resources/WindUVRTQcontrolModeKind.py +++ b/pycgmes/resources/WindUVRTQcontrolModeKind.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindUVRTQcontrolModeKind(Base): """ UVRT Q control modes MqUVRT. diff --git a/pycgmes/resources/WindingConnection.py b/pycgmes/resources/WindingConnection.py index 9197a24b..97ca1e5f 100644 --- a/pycgmes/resources/WindingConnection.py +++ b/pycgmes/resources/WindingConnection.py @@ -11,11 +11,10 @@ from pydantic.dataclasses import dataclass from ..utils.base import Base -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile -@dataclass(config=DataclassConfig) +@dataclass class WindingConnection(Base): """ Winding connection type. diff --git a/pycgmes/resources/WorkLocation.py b/pycgmes/resources/WorkLocation.py index 0b0ea997..cab7a7de 100644 --- a/pycgmes/resources/WorkLocation.py +++ b/pycgmes/resources/WorkLocation.py @@ -10,12 +10,11 @@ from pydantic.dataclasses import dataclass -from ..utils.dataclassconfig import DataclassConfig from ..utils.profile import BaseProfile, Profile from .Location import Location -@dataclass(config=DataclassConfig) +@dataclass class WorkLocation(Location): """ Information about a particular location for various forms of work. diff --git a/pycgmes/resources/__init__.py b/pycgmes/resources/__init__.py index d28faf66..cf18305e 100644 --- a/pycgmes/resources/__init__.py +++ b/pycgmes/resources/__init__.py @@ -2,5 +2,4 @@ # # SPDX-License-Identifier: Apache-2.0 -# pylint: disable=too-many-lines,missing-module-docstring CGMES_VERSION = "3.0.0" From 909eee7d754e3fa6d8e6a09cf587f6d55545288c Mon Sep 17 00:00:00 2001 From: Guillaume Roger Date: Thu, 16 Nov 2023 08:43:42 +0100 Subject: [PATCH 4/4] Remove debug leftovers Signed-off-by: Guillaume Roger --- tests/test_custom_attrs.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_custom_attrs.py b/tests/test_custom_attrs.py index fc6caa1b..2ddcae79 100644 --- a/tests/test_custom_attrs.py +++ b/tests/test_custom_attrs.py @@ -105,8 +105,6 @@ def test_customisation(self, klass, num_attrs, apparent, ns): colour = "cheese" cust = klass(colour=colour) attrs = cust.cgmes_attributes_in_profile(None) - print("PLOP") - print(attrs) assert len(attrs) == num_attrs assert f"{apparent}.colour" in attrs assert attrs[f"{apparent}.colour"]["value"] == colour