-
Notifications
You must be signed in to change notification settings - Fork 25
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
Re-factor database extension and support cell_methods in ExperimentExplorer #274
Conversation
86e60e4
to
e82bcd0
Compare
The circleci check is just timing out, so can be ignored for the moment. Still haven't actually added the cell_methods selector I realised, so will turn back into a draft .... |
This is a working version but still have a few things to work on:
|
New approach fixes the slow start-up times for the
Just as a data point for later comparison the current COSIMA master DB is indexing 115 experiments containing 379590 individual files, 9.2M variables with 56M individual attributes. No longer slow to filter restarts and coordinates. |
the realm of the model from the ncfile path. is_restart is a boolean to identify restart variables and also inferred from the ncfile path. Added hybrid property is_coordinate to CFVariable. This returns a boolean value which is True if this is a coordinate, which is inferred from the value of the units. All hybrid properties are accessible as a python method from a returned object and as a column in a query. This is moving logic from explorer into the classes themselves to simplify and speed up using the explorer GUI elements. Added inferred properties to get_variables when argument inferred is True. get_variables can now return *all* variables from *all* experiments if experiment is None. In this case it will also return the experiment name. Updated tests, but far from comprehensive.
… which contain specified variables. Added tests. Modified get_variables: can limit returned variables to those which contain search terms in variable name, long name and standard name. Added tests.
…case where path begins with model name
Added some more testing for filter selector.
Added get_cellmethods function to querying. Added cell methods selector to ExperimentExplorer.
…ly into the returned pandas Dataframe. Significantly faster and simpler to do it this way. Added separate cellmethods observe and event handler. Now cascade events from frequency > cellmethods > daterange. Updated explore tests with new cascade approach method. Tried to fix up formatting in Experiment Explorer for new cell methods label with limited success. Updated tests to work with extra new (cell_methods) field being returned from get_variables.
eef6b1b
to
e727a87
Compare
3.9 |
|
I think this is ready for review now @angus-g if you have time. |
I'll take a look now! |
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 pushed a few tweaks to queries/expressions, but otherwise it seems to make sense. This is pretty substantial! I haven't gone through all the tests too closely, so I'm assuming they're covering all the cases you need for the explorer.
Thanks for checking and making those changes. Regarding tests, if I'm honest no there aren't enough, but I ran out of motivation as creating them is a bit painful. I have added a test to make sure the hybrid I'll take a look at the |
I take that back, clearly a more motivated me added a fair bit of test coverage for |
Re-factor database extension and support cell_methods in ExperimentExplorer.
The re-factor has been on the cards for a while, and seemed like the best time to dive in.
Added hybrid properties
model
andis_restart
to toNCFile
.model
infers the realm of the model from thencfile
path.is_restart
is a boolean to identify restart variables and also inferred from thencfile
path.Added hybrid property
is_coordinate
toCFVariable
. This returns a boolean value which isTrue
if this is a coordinate,False
otherwise. It is inferred from the value ofunits
.All hybrid properties are accessible as a python method from a returned object and as a column in a query.
This is moving logic from explorer into the classes themselves to simplify and speed up using the explorer GUI elements.
Added inferred properties to
get_variables
when argumentinferred
isTrue
.get_variables
can now return all variables from all experiments ifexperiment
isNone
. In this case it will also return the experiment name.Updated tests, but far from comprehensive.
Closes #273