Skip to content
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

Updated grid implementation #84

Merged
merged 4 commits into from
Oct 24, 2022
Merged

Updated grid implementation #84

merged 4 commits into from
Oct 24, 2022

Conversation

davidorme
Copy link
Collaborator

@davidorme davidorme commented Oct 11, 2022

Description

This updates the grid system in line with the discussion in #79 and implements a first draft of neighbour lists and cell to cell distance calculations

Closes #79

Also:

Type of change

  • New feature (non-breaking change which adds functionality)
  • Optimization (back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)

Key checklist

  • Make sure you've run the pre-commit checks: $ pre-commit run -a
  • All tests pass: $ poetry run pytest

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@davidorme davidorme requested review from dalonsoa and vgro October 11, 2022 12:16
@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2022

Codecov Report

Merging #84 (f8f725e) into develop (2ba90a3) will increase coverage by 0.34%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop      #84      +/-   ##
===========================================
+ Coverage    95.07%   95.41%   +0.34%     
===========================================
  Files            6        6              
  Lines          264      262       -2     
===========================================
- Hits           251      250       -1     
+ Misses          13       12       -1     
Impacted Files Coverage Δ
virtual_rainforest/core/grid.py 93.20% <100.00%> (+0.82%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@davidorme davidorme mentioned this pull request Oct 11, 2022
7 tasks
@davidorme
Copy link
Collaborator Author

This clashes with #83 as it stands because the testing isn't typed. We should resolve that PR first.

@davidorme
Copy link
Collaborator Author

That is now resolved - tests do not require mypy annotation and so this PR is in line with develop

@davidorme
Copy link
Collaborator Author

davidorme commented Oct 21, 2022

@dalonsoa - could you review this PR. It is pretty much as we discussed. The distances[idx, idx] style interface isn't implemented because the full distance matrix isn't stored by default. I guess we could use a custom DistanceMatrix class with a __getitem__ method to set that up?

Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. I've just made a couple of comments in relation to the GridStructure class that need to be address - either way.

virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
@davidorme
Copy link
Collaborator Author

OK - I have run git revert HEAD on #74 and then used git cherry-pick to bring those changes across here. Mostly as an exercise in figuring out how to do it 😄

This is much cleaner - I've added a test for the two current Grid init failure modes.

@davidorme
Copy link
Collaborator Author

@davidorme davidorme requested a review from dalonsoa October 21, 2022 15:55
virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
virtual_rainforest/core/grid.py Outdated Show resolved Hide resolved
@davidorme davidorme merged commit 10e2809 into develop Oct 24, 2022
@davidorme davidorme deleted the feature/grid_revamp branch October 24, 2022 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants