Skip to content

Closes: #37#39

Merged
jonmarks12 merged 9 commits into
thegomeslab:mainfrom
mattball30:feature/raise_error_backtransfer
May 25, 2026
Merged

Closes: #37#39
jonmarks12 merged 9 commits into
thegomeslab:mainfrom
mattball30:feature/raise_error_backtransfer

Conversation

@mattball30

Copy link
Copy Markdown

coords.py Now raises error when backtransform fails.

@codecov-commenter

codecov-commenter commented May 7, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mlfsm/coords.py 0.00% 13 Missing ⚠️
src/mlfsm/cos.py 0.00% 3 Missing ⚠️
src/mlfsm/interp.py 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jonmarks12 jonmarks12 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR Matt, this does address the core issue of raising, but I think some suggestible LLMs may have gotten carried away :). For now please revert all of the changes in coords.py except for the raising, and we can add a larger "cleanup" issue for another time/PR

Comment thread pyproject.toml Outdated
Issues = "https://github.com/thegomeslab/ML-FSM/issues"

[tool.pixi.project]
[tool.pixi.workspace]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Lets leave this alone for now

Comment thread src/mlfsm/coords.py Outdated
return np.array(xyz_backup, dtype=np.float64)
raise RuntimeError(
f"Back transformation did not converge after {MAX_ITERATIONS} iterations.",
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is what we really want from here.

Suggested change
)
if niter > MAX_ITERATIONS:
if self.verbose:
print("R FUNCTION FAILED")
if self.verbose:
print(f"Iteration {niter}")
if self.verbose:
print(f"\tRMS(dx) = {rms_dx:10.5e}")
if self.verbose:
print(f"\tRMS(dq) = {rms_dq:10.5e}")
if raise_on_fail:
raise RuntimeError(
f"Back transformation did not converge after {MAX_ITERATIONS} iterations.",
)
else:
return np.array(xyz_backup, dtype=np.float64)

Comment thread docs/source/examples.rst

.. code-block:: python

from pathlib import Path

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok

@@ -31,7 +31,7 @@ To access the most recent features and bug fixes, install from source:
Optional: Calculator Dependencies
--------------------------------------

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ok

Comment thread src/mlfsm/interp.py
@@ -1,7 +1,7 @@
"""Interpolation methods for constructing paths between endpoint geometries."""

from collections.abc import Callable

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤔

@joegomes

Copy link
Copy Markdown
Collaborator

@mattball30 Thank you for the contribution! The option to raise an error on backtransformation failure is a nice improvement.

@jonmarks12 I've review the changes made in the PR and am ready to merge when you are.

@jonmarks12 jonmarks12 merged commit 06cbcbb into thegomeslab:main May 25, 2026
4 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.

4 participants