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

Initialize context from backend #156

Merged
merged 5 commits into from
Apr 6, 2024
Merged

Initialize context from backend #156

merged 5 commits into from
Apr 6, 2024

Conversation

zihaoxu98
Copy link
Collaborator

This PR adds a class method that allows context to be initialized from a backend file. The continue_fitting is also modified a bit for better experience.

If you have a backend from a fitting, and want to continue, now you just need to

tree = apt.Context.from_backend('./backend.h5')
tree.continue_fitting(iteration=10)

The original backend file will be appended to new walkers.

@zihaoxu98 zihaoxu98 requested a review from dachengx April 5, 2024 00:38
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 @zihaoxu98 . Looks good. Please try to add pytest of continue_fitting and from_backend.

@coveralls
Copy link

coveralls commented Apr 6, 2024

Pull Request Test Coverage Report for Build 8583100372

Details

  • 26 of 28 (92.86%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 85.47%

Changes Missing Coverage Covered Lines Changed/Added Lines %
appletree/context.py 25 27 92.59%
Totals Coverage Status
Change from base Build 8582131298: 0.3%
Covered Lines: 2300
Relevant Lines: 2691

💛 - Coveralls

@dachengx dachengx merged commit b9ecb17 into master Apr 6, 2024
7 checks passed
@dachengx dachengx deleted the from_bkend branch April 6, 2024 19:05
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