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

Fix tests #146

Merged
merged 8 commits into from
Mar 14, 2024
Merged

Fix tests #146

merged 8 commits into from
Mar 14, 2024

Conversation

frostedoyster
Copy link
Collaborator

@frostedoyster frostedoyster commented Mar 13, 2024

@frostedoyster
Copy link
Collaborator Author

frostedoyster commented Mar 13, 2024

@PicoCentauri I have no clue what's going on with test_train_model.py. It seems to be hydra-related. Could you please have a look? I've fixed the others

@frostedoyster
Copy link
Collaborator Author

frostedoyster commented Mar 14, 2024

Although I haven't been able to pinpoint the issue, it seems that it is a bug caused by the interaction of python 3.8's standard libraries (pathlib, importlib which are used inside hydra), hydra, and the GitHub actions virtual environment (because I have python 3.8 locally and everything is fine). This would be very difficult to solve on our own.

We have to drop either python 3.8 or hydra. For the moment, I've updated the code to require python 3.9 because it's the easiest solution (python 3.8 would have to be dropped soon-ish anyway), but we should also consider dropping hydra IMO. I will open an issue for it.

@frostedoyster frostedoyster changed the title Debug CI Fix tests Mar 14, 2024
@@ -123,7 +123,9 @@ def test_read_virial_warn(monkeypatch, tmp_path):
ase.io.write(filename, systems)

with pytest.warns(match="Found 9-long numerical vector"):
results = read_virial_ase(filename=filename, key="stress-9")
results = read_virial_ase(
filename=filename, key="stress-9", dtype=torch.get_default_dtype()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is float64 not working. Isn't the default one 64-bit?

Copy link
Member

Choose a reason for hiding this comment

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

PyTorch default dtype if the user does nothing is float32

@@ -36,7 +36,9 @@ def test_compute_model_loss():
model = soap_bpnn.Model(capabilities)
# model = torch.jit.script(model) # jit the model for good measure

systems = read_systems(RESOURCES_PATH / "alchemical_reduced_10.xyz")[:2]
systems = read_systems(
RESOURCES_PATH / "alchemical_reduced_10.xyz", dtype=torch.get_default_dtype()
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above I rather would like to set an explicit dtype here.

@frostedoyster frostedoyster merged commit 555c01c into main Mar 14, 2024
11 checks passed
@frostedoyster frostedoyster deleted the debug-ci branch March 14, 2024 10:50
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