Skip to content

Updated grid implementation#84

Merged
davidorme merged 4 commits intodevelopfrom
feature/grid_revamp
Oct 24, 2022
Merged

Updated grid implementation#84
davidorme merged 4 commits intodevelopfrom
feature/grid_revamp

Conversation

@davidorme
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Collaborator Author

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

@davidorme
Copy link
Copy Markdown
Collaborator Author

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

@davidorme
Copy link
Copy Markdown
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
Copy Markdown
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.

@davidorme
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

@davidorme davidorme requested a review from dalonsoa October 21, 2022 15:55
@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

Development

Successfully merging this pull request may close these issues.

Simplify grid cell indexing system Convert TODOs in grid.py to GitHub issues Add tests for functions/methods in grid.py

4 participants