-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improve jump specification criteria #228
Conversation
Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/e44462d6021bfe23dfb24b775cc7c390844f773d' (2023-11-12) → 'github:nixos/nixpkgs/91a00709aebb3602f172a0bf47ba1ef013e34835' (2023-12-17)
Flake lock file updates: • Updated input 'nixpkgs': 'github:nixos/nixpkgs/91a00709aebb3602f172a0bf47ba1ef013e34835' (2023-12-17) → 'github:nixos/nixpkgs/317484b1ead87b9c1b8ac5261a8d2dd748a0492d' (2024-01-08)
Jumps now only count if they reach the inner fraction of a site
@AstyLavrinenko, @stefsmeets a notebook with the changes can be found here: https://gemdat.readthedocs.io/en/jumps_update/notebooks/jumps/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @v1kko , thanks for this. I understand the goal of the PR is to split off the jumps related code into its own class. Changing events into a dataframe will be super useful going forward.
To my taste this PR is too large, so I wasn't able to consider the changes as a whole. Some of the code became a bit too complex for me to fully grasp what is going on. So I just left some comments as I went through the code.
I have 2 major points of concern:
-
The changes are useful, and decoupling of
Jumps
is a nice step forward. My concern is the complexity of the code and api, which has also taken a leap. I think it would be useful to go through the code and make sure the docstrings are up to date, that we avoid returning tuples (a code smell, if you ask me), and to refactor a bit to make sure that the api still pleasant to work with. -
The test data for the integration test are completely different. It's not clear to me exactly from the PR what has changed or why this is. This makes it difficult to verify the correctness of the code. Some small differences can be expected, but the results here are completely different. To me it indecates a problem with the code if we cannot reproduce the results from our test data.
Thanks for looking. I don't think it can be helped that this PR is so large, introducing "configurable" jumps unfortunately touches almost everything, but suggestions are welcome. I don't think returning tuples is always bad, but I can fix it here. Number 2 is because most of these numbers did not make sense (especially the calculation of solo and collective jumps). This is now improved, so this change is expected, and discussed with Alexandros. I should have mentioned it before. If you look at the figures for jumps for example those are still similar. |
My gripe is that it leads to unmaintainable code. Adding another item breaks all code downstream (Similar to having functions with many positional arguments). I find that in most cases it is easier in the long run to return a dataclass, namedtuple or dict, so that variables can be accessed by name, rather than by index. Usually, I find that this leads to a better design.
I see now that the 450 comes back in other places. 👍 I wasn't aware that there were some issues with the previous implementation. I'm still curious what you think about all those other values being so far off. |
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
_generic_transitions_to_jumps
which is used as default, and can be used to write your own converter.