-
Notifications
You must be signed in to change notification settings - Fork 8
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
Implementation of Community object init and factory methods. #282
Conversation
…ds with different marshmallow schemas
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #282 +/- ##
===========================================
- Coverage 95.29% 95.13% -0.16%
===========================================
Files 28 32 +4
Lines 1720 2077 +357
===========================================
+ Hits 1639 1976 +337
- Misses 81 101 +20 ☔ View full report in Codecov by Sentry. |
There is still a doc failure - We could just add this to the growing pile of noise in our |
…of-community-object
I've had a good poke around this code and it looks ok to my eye. I can't claim to be completely abreast of the science, but I like the fact you're rolling out this 'schema' approach that flows from what we discussed for the prior flora PR. The approach seems sensible. I did I quick check and there is a GPU drop (cuDF) in for pandas. Hopefully this should mean that all this is compatible with the array api stuff I've been talking about. Happy to approve once the docs are fixed |
I haven't had time to dig into this issue at all I'm afraid. I'd hope we can fix it rather than ignore. |
Co-authored-by: James Emberton <[email protected]>
@j-emberton Thanks for the worked example and other requests. Should all be good now. I have just |
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.
Following discussion and changes, happy to review
Description
This PR brings in a Community object based of @AmyOctoCat's work in PR #230. From the features listed in #278, we have a (mostly) complete implementation with some elements postponed for later PRs:
Note
pandas.DataFrame
for storing cohort data. I think that reverses something I told @AmyOctoCat (sorry!), but although there is overhead in using the Dataframe rather than simple arrays as attributes, it does simplify the namespace of the class a lot and it is also much cleaner to add and delete cohorts as rows rather than having to iterate over individual attributes.Note
Community
objects yet - might as well sense check the single case before doing that!Community
object.Note
This PR also updates
Flora
to provide apandas.Dataframe
view of the flora data, which makes it super easy to merge onto the cohort data.There's some complexity in the serialisation formats and schemas:
Community
object needs single values forcell_area
andcell_id
but arrays for the cohort data.The validation schemas take these two slightly different approaches, validate them and then coerce to the common arguments used for initialisation.
Fixes #278
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks