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

Only count flags in reflux_star if star is not already flagged #178

Merged
merged 16 commits into from
Mar 3, 2025

Conversation

rmjarvis
Copy link
Owner

@PFLeget noticed a bug in reflux_stars that can cause an (almost) infinite loop. The problem is that any exception encountered while refluxing gets flagged. But this happens even if the star is already flagged. Then in the main fitting routine, it sees what it thinks is a new flagged object and iterates, even if it is the same object failing every time.

The fix is to only count the failure in nremoved if the object is not already flagged.

@rmjarvis rmjarvis added this to the Version 1.5 milestone Feb 25, 2025
@rmjarvis rmjarvis force-pushed the reflux_infinite_loop branch from 9b99a2a to d84fa54 Compare February 25, 2025 21:03
@rmjarvis rmjarvis requested a review from PFLeget February 26, 2025 04:55
@PFLeget
Copy link
Collaborator

PFLeget commented Feb 26, 2025

I just fixed the problem in treegp for python 3.13 and it is working now. You need to use version 1.3.0 now (I just pushed it).

@rmjarvis
Copy link
Owner Author

Thanks. That seems to have worked.

@PFLeget
Copy link
Collaborator

PFLeget commented Feb 26, 2025

Do you want me to add a unit test for this?

@rmjarvis
Copy link
Owner Author

I did add one using mock to force the failure. But if you have something more realistic, that would be great.

@PFLeget
Copy link
Collaborator

PFLeget commented Feb 26, 2025

I asked, and I am allowed to put a sample of the data that made the original problem. I have an example with ~30 stamp of real stars, I would be happy to add it for this, but it will allow me to add other unit test latter on for the cpp solver.

@rmjarvis
Copy link
Owner Author

Perfect. Yeah, that would be great.

@PFLeget
Copy link
Collaborator

PFLeget commented Feb 28, 2025

I added the test that looks to work on all versions of Python except 3.8. Is it ok to not support python 3.8?

It looks like python 3.8 is not maintained anymore (https://devguide.python.org/versions/) and when I am trying to have the last version of numpy (numpy>=2.0), it does not support python 3.8.

Copy link
Collaborator

@PFLeget PFLeget left a comment

Choose a reason for hiding this comment

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

It looks good to me. If you are happy with my last changes, this is good to me. I see the PR is in direction of v1.5, shall it be towards main or am I missing something?

@rmjarvis
Copy link
Owner Author

rmjarvis commented Mar 3, 2025

I see the PR is in direction of v1.5, shall it be towards main or am I missing something?

This is a bugfix. So we can release it as a bugfix release on the 1.5.x series. I'll cherry-pick the commits over to main as well ofc.

@rmjarvis rmjarvis merged commit dab4c89 into releases/1.5 Mar 3, 2025
9 checks passed
@rmjarvis rmjarvis deleted the reflux_infinite_loop branch March 3, 2025 18:02
@rmjarvis
Copy link
Owner Author

rmjarvis commented Mar 3, 2025

v1.5.1 is released with this bugfix. It's on pypi so far. Should be on conda later today.

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.

2 participants