-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pydantic
BaseModel
s
Breaking behaviour: In case no `Group` with `group_label` exists, submission controllers created the specified group upon instantiation. This means is the user simply had a typo in the label upon instatiation of the controller, a new (useless) group was created. Here we adapt this behaviour to check for the groups existence instead. This is done by converting the controller classes into `pydantic` `BaseModel`s and using a `validator`. Using `BaseModel` has a few added benefits: 1. Much cleaner constructor specification, that is inherited by sub classes. This becomes especially appreciable for more complex submission controllers. 2. Automatic validation on all constructor inputs. 3. Adds type hinting to all constructor inputs, which makes the classes much more user friendly and facilitates development. 4. `pydantic` `BaseModel`s come with built-in JSON serialization support, which makes it easier to store and recreate submission controllers from JSON files. If we want to set up reproducable HTC infrastructure, this may come in handy.
- Loading branch information
Showing
4 changed files
with
56 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters