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

Add multiple nodep_data_names support #187

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

mhliu0001
Copy link
Contributor

@mhliu0001 mhliu0001 commented Sep 29, 2024

Previously only one nodep_data_name is supported. Most of the time we are setting this to "batch_size". But sometimes it is necessary to set multiple nodep_data_names, like ["x", "y", "z", "num_photons", "num_electrons"]. This PR adds support for multiple nodep_data_names.

MWE:

import appletree as apt
er = apt.ERBand(bins=[bins_cs1, bins_cs2], bins_type="irreg")
er.deduce(data_names=["s1_area", "s2_area", "anti_correlation_eff"], nodep_data_names=["num_photon", "num_electron", "x", "y", "z"], force_no_eff=True)
er.compile()
print(er.code)

@coveralls
Copy link

coveralls commented Sep 29, 2024

Pull Request Test Coverage Report for Build 11167818604

Details

  • 11 of 12 (91.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 85.221%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/component.py 11 12 91.67%
Totals Coverage Status
Change from base Build 10709265769: 0.03%
Covered Lines: 2445
Relevant Lines: 2869

💛 - Coveralls

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.

Please:

  1. Add a test for this new feature
  2. Make sure that all nodep_data_name has been changed to nodep_data_names

appletree/component.py Outdated Show resolved Hide resolved
@mhliu0001 mhliu0001 marked this pull request as draft September 29, 2024 15:50
@mhliu0001 mhliu0001 marked this pull request as ready for review October 3, 2024 18:45
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.

3 participants