-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make schema dict immutable #19
Merged
Merged
Conversation
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
- Introduced LockableDict, LockableList, which can prevent modifications to themselves - New SchemaDict class subclass of LockableDict which is locked in __init__ and also includes some helper methods from schema_dict_util
…n LockableDict/List. Not optimal maybe I have to think about the inheritance structure again
…y builtin types are converted into lockable types This means that e.g. any subclass of UserDict will still be mutable if it does not subclass LockableDict I think this is a good compromise. Otherwise Functionality is lost silently
…for these objects more understandable
…che) and initialization from concrete file paths Adapted parametrized tests for new classes with data_regression create_inpschema_dict and create_outschema_dict now expect the complete filepath to the schema file
janssenhenning
added
enhancement
New feature or request
parser/fleur
Issues related to the file parsers for fleur
labels
Feb 9, 2021
LockableList needs to be converted manually after __init__ to propagate locking to sublists/dicts
Codecov Report
@@ Coverage Diff @@
## develop #19 +/- ##
===========================================
+ Coverage 71.37% 71.82% +0.44%
===========================================
Files 71 60 -11
Lines 9196 9305 +109
===========================================
+ Hits 6564 6683 +119
+ Misses 2632 2622 -10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also see #16
This pull request adds the following things:
freeze
has been called on the objectschema_dict.py
filesget_tag_xpath
,get_attrib_xpath
andget_tag_info
)fromVersion
) and explicit filepaths (fromPath
)get_unlocked()
on the object (either the whole schema dict or the specific part you want to modify)This made the following functions unnecessary and they are removed:
update_schema_dicts
,load_inpschema
,load_outschema