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

fix meshgrid binning #101

Merged
merged 7 commits into from
Jun 18, 2023
Merged

fix meshgrid binning #101

merged 7 commits into from
Jun 18, 2023

Conversation

hoetzsch
Copy link
Contributor

Meshgrid binning fix (by Zihao). To be nicified

appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

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

Thanks, @hoetzsch . After the requested changes are met, I think it is good to merge.

appletree/likelihood.py Show resolved Hide resolved
@@ -52,8 +53,14 @@ def __init__(self, name: str = None, **config):
warning = f'The usage of meshgrid binning is highly discouraged.'
warn(warning)
self.component_bins_type = 'meshgrid'
x_bins = jnp.linspace(*config['x_clip'], self._bins[0] + 1)
y_bins = jnp.linspace(*config['y_clip'], self._bins[1] + 1)
if isinstance(self._bins[0], int):

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
WPS204 Found overused expression: self._bins[0]; used 8 > 4

appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
@hoetzsch hoetzsch marked this pull request as ready for review June 16, 2023 15:48
@hoetzsch
Copy link
Contributor Author

@dachengx thanks, changed it!

@coveralls
Copy link

coveralls commented Jun 17, 2023

Pull Request Test Coverage Report for Build 5303825558

  • 6 of 18 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 83.093%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/likelihood.py 6 18 33.33%
Totals Coverage Status
Change from base Build 5255767023: -0.3%
Covered Lines: 1902
Relevant Lines: 2289

💛 - Coveralls

appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
tests/test_likelihood.py Show resolved Hide resolved
tests/test_likelihood.py Show resolved Hide resolved
tests/test_likelihood.py Outdated Show resolved Hide resolved
tests/test_likelihood.py Outdated Show resolved Hide resolved
appletree/likelihood.py Show resolved Hide resolved
)
llh = apt.Likelihood(**instruct)
error_raised = False
except Exception:

Choose a reason for hiding this comment

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

[pep8] reported by reviewdog 🐶
S110 Try, Except, Pass detected.

Copy link
Collaborator

@dachengx dachengx left a comment

Choose a reason for hiding this comment

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

I added some tests and warnings. Looks good now.

@dachengx dachengx merged commit adbd023 into master Jun 18, 2023
7 checks passed
@dachengx dachengx deleted the binning branch June 18, 2023 13:14
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