-
Notifications
You must be signed in to change notification settings - Fork 5
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
ScmEnsemble #128
base: main
Are you sure you want to change the base?
ScmEnsemble #128
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Looks a good start. I guess it makes sense to get this in, then switch to some sort of xarray backend (dealing with #127 in the process) and then we'd have a pretty clear path to dealing with some sort of lazy loading over lots of runs..?
@@ -0,0 +1,226 @@ | |||
""" | |||
:class:`ScmEnsemble` provides a container for holding data from different model runs. |
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.
:class:`ScmEnsemble` provides a container for holding data from different model runs. | |
:class:`ScmEnsemble` provides a container for holding data from different model runs. | |
This is particularly useful for holding a collection of data on different time axes, without | |
having to put all the data on the same time axes first (which can be a moderately expensive | |
operation). |
""" | ||
str: Name of meta containing a unique identifer for each run | ||
|
||
If no value is provided, then an implicit value is create. This ensures that every timeseries |
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.
If no value is provided, then an implicit value is create. This ensures that every timeseries | |
If no value is provided, then an implicit value is created. This ensures that every timeseries (across all :obj:`ScmRun` objects) |
items.append(r[item]) | ||
except KeyError: | ||
continue | ||
if not len(items): |
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.
if not len(items): | |
if not items: |
pdt.assert_frame_equal( | ||
ensemble.runs[0].timeseries().reset_index(), | ||
res.xs(0, level="run_id").dropna(how="all", axis="columns").reset_index(), | ||
check_like=True, # To remove once #97 is resolved |
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.
check_like=True, # To remove once #97 is resolved | |
check_like=True, |
What is #97? Can be removed right?
|
||
assert res.run_ids == [0, 1] | ||
|
||
# TODO: fix inconcistency with columns type of timeseries |
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.
Now fixed?
|
||
def __init__(self, runs=None): | ||
""" | ||
|
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.
Are we intending on adding more loading functionality? If no, we should change the notebook
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.
Just looked at the notebook properly, assuming we're waiting to sort this before we start mucking around with writing the notebook?
Pull request
Please confirm that this pull request has done the following:
CHANGELOG.rst
addedThoughts before I flesh out docs
Closes #98