Skip to content

Fix CI failures due to domain transforms #108

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

Merged
merged 8 commits into from
Mar 14, 2025

Conversation

thomaswmorris
Copy link
Contributor

This fixes #106, which was a subtle bug about data type mismatches on trust domain boundaries which introduced some nans. While I was bug hunting I also cleaned up some other stuff, including the plotting code.

Copy link
Contributor

@thomashopkins32 thomashopkins32 left a comment

Choose a reason for hiding this comment

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

Looks good functionality-wise!

Most of my comments relate to some confusion I have regarding what is going on in the code along with some minor design considerations. I think more inline explanations and docstrings could be very beneficial. There are a lot of new people on the project that could benefit from them.

If you disagree with any of my comments please let me know and we can discuss further.

Comment on lines 205 to 207
@property
def all_valid(self) -> bool:
return not (self.validity_conjugate_model and self.validity_probability)
Copy link
Contributor

@thomashopkins32 thomashopkins32 Mar 13, 2025

Choose a reason for hiding this comment

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

Double checking intention on logic here, maybe worth adding it as a comment with explanation.

If either the validity_conjugate_model or the validity_probability are not defined, then all are valid. Why is this the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Objective gets its model from the _construct_model() method in the Agent, which gives it a validity_conjugate_model if it detects any invalid points (otherwise it's None). So if this attribute is not None then the points are all valid. But whether the points are all valid depend on the other objectives and the enforce_all_objectives_valid flag, so we have to do it in this sort of roundabout way.

@thomaswmorris
Copy link
Contributor Author

I'll add some docstrings in the next PR, but this one should go out just to fix the bugs/CI failures.

@thomashopkins32
Copy link
Contributor

The plotting functions need to remove the update_models() part, its not part of their responsibility to update the models.

@thomashopkins32
Copy link
Contributor

I'll let this PR move forward and we can decide on whether the plotting functions should update models at a later time. Discussion in #109

@thomaswmorris thomaswmorris merged commit 3f8f20b into NSLS-II:main Mar 14, 2025
5 checks passed
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.

Fix test_agents.py::test_agent[1d_1f]
2 participants