-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
feat: use SortedSet
in model to improve reproducibility
#235
Conversation
Added `__lt__()` to all model classes used in SortedSet, with tests Explicitly declared Enums as (str, Enum) to allow sorting Added dependency to sortedcollections package Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Remove unused imports and trailing whitespace. Sort usings in pyi file. Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
I've fixed all those, I think. I have an outstanding mypy error I don't know how to resolve:
I've tried replacing I'll try to look at the other lift issues - some are real, some are cosmetic (e.g. parameter names on overrides) |
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
@jkowalleck Ah - it also seems to be failing on python 3.8 and earlier! Any thgouhts?
|
re:
the typing.Tuple might help. from typing import Tuple
class Foo(Tuple[TypeOfItem1, and so on ]):
... regarding |
Change tuple -> Tuple Fix Diff initialization Add sorting to AttachedText Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
That was my initial implementation, and it was OK for the XML serialization, but the JSON serialization doesn't explicitly iterate the collections when serializing so it didn't work. This approach is more consistent across serializers. |
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
Signed-off-by: Rodney Richardson <rodney.richardson@cambridgeconsultants.com>
@jkowalleck I have resolved all issues, and and CI jobs are passing now. This is ready for review/merge. FYI: To solve the type hint issues in python < 3.8, I needed to put |
Thanks for the feature, @RodneyRichardson will review the PR when i have time. This means, that the PR will take it's time. |
SortedSet
in model to improve reproducibility
bumped could you rebase onto latest "main" branch, @RodneyRichardson ? |
I have merged main into the PR/branch (just clicking the button in Github). Is this sufficient? Or do you need me to rebase the entire branch into a single commit? (I've not rebased on Github before). |
no, thats fine. |
@RodneyRichardson - many thanks for your great contribution here. All looks good to me, so we'll get this merged imminently! |
Added
__lt__()
to all model classes used in SortedSet, with testsExplicitly declared Enums as (str, Enum) to allow sorting
Added dependency to sortedcollections package
Added ComparableTuple to make sorting compound objects easier
Signed-off-by: Rodney Richardson rodney.richardson@cambridgeconsultants.com