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

Convert PDF spectrum to CDF by default #72

Merged
merged 5 commits into from
Dec 19, 2022
Merged

Convert PDF spectrum to CDF by default #72

merged 5 commits into from
Dec 19, 2022

Conversation

zihaoxu98
Copy link
Collaborator

This PR will convert the x vs PDF map to CDF vs x map by default, to facilitate energy sampler.

appletree/utils.py Outdated Show resolved Hide resolved
appletree/utils.py Outdated Show resolved Hide resolved
appletree/config.py Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Dec 15, 2022

Pull Request Test Coverage Report for Build 3733004478

  • 5 of 20 (25.0%) changed or added relevant lines in 2 files are covered.
  • 142 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-1.03%) to 79.018%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/utils.py 1 7 14.29%
appletree/config.py 4 13 30.77%
Files with Coverage Reduction New Missed Lines %
appletree/share.py 1 90.0%
appletree/context.py 15 83.09%
appletree/component.py 46 67.27%
appletree/utils.py 80 37.87%
Totals Coverage Status
Change from base Build 3623795858: -1.03%
Covered Lines: 1352
Relevant Lines: 1711

💛 - Coveralls

@@ -498,3 +498,17 @@ def _add_extension(module, subclass, base):
)
else:
setattr(module, subclass.__name__, subclass)


def integrate(x, y):
Copy link
Collaborator

Choose a reason for hiding this comment

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

These functions are not necessarily being here as long as they are only used in appletree/config.py.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Because they are some calculation but not really utilities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am thinking these functions will be used for the normalization of an analytical spectrum, which will be called again somewhere in component.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Then please rename the functions with the method(s) applied specifically. Like 'midpoint', or 'binned'.

@@ -498,3 +498,22 @@ def _add_extension(module, subclass, base):
)
else:
setattr(module, subclass.__name__, subclass)

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

appletree/utils.py Show resolved Hide resolved
appletree/utils.py Show resolved Hide resolved
"""
_, res = cum_integrate(x, y)
return res[-1]

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

appletree/config.py Show resolved Hide resolved
@@ -498,3 +498,24 @@ def _add_extension(module, subclass, base):
)
else:
setattr(module, subclass.__name__, subclass)


Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

_, res = cum_integrate_midpoint(x, y)
return res[-1]


Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
W291 trailing whitespace

@dachengx dachengx self-requested a review December 19, 2022 16:00
@dachengx dachengx merged commit e00d51e into master Dec 19, 2022
@dachengx dachengx deleted the sample_spec branch December 19, 2022 16:01
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.

None yet

3 participants