-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
First draft of the data loading system #122
Conversation
…r and stricter cell coverage
…th fixed seed to make more static
…more systematicaaly less permissive of data flaws
…ation for a greater extent/set of cells
@alexdewar Thanks for that review. I've made the following changes:
@vgro - does that sound sensible? We now have a systematically strict approach on matching data in inputs onto the configuration. @alexdewar - are you happy to re-review? None of this changes the wider structure/function/docs but does make for a cleaner slimmed down codebase. I have not removed the multi-format support in |
I had missed a fix in the docs, so @TaranRallings and @jacobcook1995 - could you review the HTML pages on RTD? Links again: Descriptions for users: @alexdewar Do those code changes seem ok? |
The |
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.
Docs look good to me, had a few small suggestions and a query, but nothing major
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.
I've only had a quick look-through this time, but it's looking good to me!
Description
This is quite a big PR providing a first draft of the data loading system. More docs needed, but the module docstrings and the intro
data.md
show the main idea.The basic idea is:
xarray.DataArray
objects - handy indexing and selection methods etc. It exposes the dictionary interface for getting values (data['var']
gets the DataArray forvar
) but also contains other data and methods.load_dataarray
before they get added. There is registry that allows the definition of dimension specific mapping and validation - just implemented for spatial dimensions at present, but we'll need to apply it to temporal once this PR and Main timing loop #121 are all in merged intodevelop
.load_dataarray
to giveload_from_file
. That uses another registry that allows people to define file format specific recipes to turn.xyz
into a data array.load_from_file
that allows a config file to be used to addThere are some things that need fixing - particularly in setting which dimensions a variable has to match. We also need to hash out the group of core fixed dimensions: space, time, soil layers, etc.
Fixes #104
Type of change
Key checklist
pre-commit
checks:$ pre-commit run -a
$ poetry run pytest
Further checks