Closed aidanheerdegen closed 3 years ago
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:
var
+ frequency
+ cell_methods
, so don't have any way to update the time range. So it can be (almost certainly is) misleading.New approach fixes the slow start-up times for the DatabaseExplorer
and ExperimentExplorer
> %%time
> dbx = DatabaseExplorer(session=session)
CPU times: user 16.3 s, sys: 1.04 s, total: 17.3 s
Wall time: 17.3 s
> %%time
> ee = ExperimentExplorer(session=session, experiment='01deg_jra55v140_iaf')
CPU times: user 6.58 s, sys: 498 ms, total: 7.08 s
Wall time: 7.07 s
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.
what's the python version that conda-analysis3 runs?
3.9
21.04
uses 3.8. I don't think it is a big deal. It is some weird pytest
related error. Doesn't happen outside of testing AFAICT.
I think this is ready for review now @angus-g if you have time.
I'll take a look now!
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 model
property is consistent between the two methods of invocation.
I'll take a look at the cell_methods
stuff to make sure there is appropriate test coverage.
I take that back, clearly a more motivated me added a fair bit of test coverage for cell_methods
. I think I'm happy to merge if you are @angus-g.
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