General updates and PEP8 code cleanup#385
Merged
jgrewe merged 21 commits intoG-Node:masterfrom Apr 22, 2020
Merged
Conversation
Closes G-Node#359 Changed plain Exception in '_parse' to odml.tools.parser_utils.ParserException.
The terminology test was removed since - the test should not depend on an offsite repository. - should be in its own file 'test_terminology'.
Refactors the Property.export_leaf method and the corresponding tests. When exporting a document from a Property the direct parent now also exports all Properties and not just the Property that starts the export.
Reducing the impressive number of pylint warnings; this fixes the following issues: - no-else-raise - consider-using-in - import-outside-toplevel - inconsistent-return-statements - unnecessary-comprehension
This commit fixes the following PEP98 code warnings: - no-else-return - no-else-raise - protected-access (section._merged) - no-self-use (_convert_value_input -> staticmethod)
This commit fixes the following PEP8 code warnings: - function-redefined - no-else-return - no-else-raise - inconsistent-return-statements - no-self-use (staticmethod: _validate_parent)
The terminology refresh test requires a brief sleep between creating the original file and the refresh of the same file to receive different mtimes. On Linux 0.100s is sufficient, macOS requires a time > 0.700ms.
jgrewe
approved these changes
Apr 22, 2020
Member
jgrewe
left a comment
There was a problem hiding this comment.
this was a big beast, thanks for the effort
|
|
||
| p2 = Property("test", {"name": "Marie", "name": "Johanna"}) | ||
| self.assertEqual(len(p2), 1) | ||
| prop2 = Property("test", {"name": "Marie"}) |
Member
There was a problem hiding this comment.
oh, no, you destroyed the old pun: "Marie Johanna" ;)
Contributor
Author
There was a problem hiding this comment.
I did not even get that one... makes me sad, but I shall be strong and endure it. :p
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This large PR adds various updates and general cleanups for simplification and PEP8 compliance.
In detail it
odml.Document.origin_file_nameattribute. This closes issue [Document] Add '_origin_file_name' accessor methods #358.odml.tools.converters.VersionConvertertoodml.tools.parser_utils.ParserException. This closes issue [VersionConverter] Specify Exception in 'convert' method #359.test/test_terminology.pyand adds a test for theterminology.refreshmethod.odml.Property.export_leafmethod to also include sibling properties in the export.pprintand the addedcardinalityfeature and adds a link to thetemplateshosting site.