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

Negative velocities #64

Merged
merged 6 commits into from
Jun 15, 2023
Merged

Negative velocities #64

merged 6 commits into from
Jun 15, 2023

Conversation

Sosnowsky
Copy link
Member

I am working with something that requires the velocities to be negative. Even though there are physical arguments to why this might not be the case, I believe the code should be able to handle negative velocities. I also need that to test my estimation methods in the case of negative radial velocities.

I also added the blob_alignment parameter to keep me from going insane. I can remove it if you believe if is not necessary.

The compute_start_stop method from the model is getting a bit complicated and hard to read, we should maybe consider a refactor.

@@ -75,6 +75,40 @@ def test_single_point():
assert error < 1e-10, "Numerical error too big"
Copy link
Member

Choose a reason for hiding this comment

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

As far as I can see blob_alignment is actually never tested. Could we include a specific test?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, the reason I didn't add was because I didn't find any test for the actual alignment implementation either (the current blob tests work both for alignment true and false, without changing expected values)

@@ -23,6 +24,7 @@ def __init__(
t_drain: Union[float, NDArray],
prop_shape_parameters: dict = None,
perp_shape_parameters: dict = None,
blob_alignment: bool = True,
Copy link
Member

Choose a reason for hiding this comment

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

If we want to keep the blob alignment it would probably make sense to access it in the model class. What do you think?

Copy link
Member Author

Choose a reason for hiding this comment

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

I had it there first. I changed it to the forcing class to minimize interface changes since I guess most people will not care whether their blobs are aligned or not. I can add it there, it is just to send it straight to the forcing constructor.

blobmodel/stochasticality.py Show resolved Hide resolved
@gregordecristoforo gregordecristoforo merged commit f199304 into main Jun 15, 2023
@gregordecristoforo gregordecristoforo deleted the negative_velocities branch July 14, 2023 12: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.

2 participants