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

Sensitivity #63

Draft
wants to merge 45 commits into
base: dev
Choose a base branch
from
Draft

Sensitivity #63

wants to merge 45 commits into from

Conversation

jnnr
Copy link
Collaborator

@jnnr jnnr commented May 29, 2022

Allows to create new EnergyDatapackages from two existing EnergyDatapackages and a sampling function. First implemented sampling functions

  • Linear slide: LInear interpolation between the two datapackages.
  • SAlib sampling methods, e.g. latin hypercube sampling Sensitivity salib #64

Copy link
Collaborator Author

@jnnr jnnr left a comment

Choose a reason for hiding this comment

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

Some comments:

oemoflex/model/variations.py Show resolved Hide resolved
oemoflex/model/variations.py Show resolved Hide resolved
oemoflex/model/variations.py Show resolved Hide resolved
oemoflex/model/variations.py Show resolved Hide resolved
oemoflex/model/variations.py Show resolved Hide resolved
self.eps,
).all(), f"The difference between lb and ub is lower than the defined minimum of {self.eps}"

def get_diff(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Revise naming

def get_diff(self):
return get_diff(self.lb.loc[:, self.VAR_VALUE], self.ub.loc[:, self.VAR_VALUE])

def get_param(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Revise naming


return _dp
def sanity_check(self):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Decouple sample method and sanity check.

return full_samples


class EDPSensitivity(Sensitivity):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This could be done more general. The above Sensitivity class does checking and sampling for a single dataframe. This class is supposed to do the same for DataFramePackages.

The implementation takes some time to grasp - could be more transparent?

# assert that the last sample equals the upper-bound datapackage
assert frame_containing_nan_equal(
samples["sample_" + str(n - 1)], edp_ub_stacked.data["component"]
)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Add a check that actually compares results files.

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.

1 participant