Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

ScmEnsemble #128

wants to merge 9 commits into from

Conversation

lewisjared
Copy link
Collaborator

Pull request

Please confirm that this pull request has done the following:

  • Tests added
  • Documentation added (where applicable)
  • Example added (either to an existing notebook or as a new notebook, where applicable)
  • Description in CHANGELOG.rst added

Thoughts before I flesh out docs

Closes #98

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@znicholls znicholls left a 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

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):
"""

Copy link
Collaborator

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

Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScmEnsemble
2 participants