Skip to content

One attempt to fix ChemEnv error in tests #2792

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 3 commits into from
Jan 6, 2023

Conversation

JaGeo
Copy link
Member

@JaGeo JaGeo commented Jan 6, 2023

Summary

As discussed in #2788, one way of fixing the ChemEnv error in the tests would be converting the PeriodicNeighbor object in a PeriodicSite object. I have implemented this. It might however affect the execution speed.

If someone else, manages to fix the as_dict from PeriodicNeighbor in a cheaper way, I would prefer this, of course.

@JaGeo
Copy link
Member Author

JaGeo commented Jan 6, 2023

Linting still fails but tests are running through.
Please let me know what you think and if you have any better/faster ideas (@shyuep , @janosh). Both species and coordinates are influenced when using from_dict and as_dict from PeriodicNeighbors.

@coveralls
Copy link

coveralls commented Jan 6, 2023

Coverage Status

Coverage: 78.018% (+7.9%) from 70.155% when pulling f31ab03 on JaGeo:bug_fix into 811dd75 on materialsproject:master.

@shyuep shyuep merged commit c1a7f5d into materialsproject:master Jan 6, 2023
@shyuep
Copy link
Member

shyuep commented Jan 6, 2023

Thanks. This is fine. I'd rather it be working and slower. Someone else can go figure out a faster method if it bothers them. Most people would not care.

@janosh
Copy link
Member

janosh commented Jan 6, 2023

This doesn't look like much a slowdown anyway.

@janosh
Copy link
Member

janosh commented Jan 6, 2023

Thanks @JaGeo. Good to have green CI again. Like you said, makes contributing much easier. I'll close #2788 now.

@JaGeo
Copy link
Member Author

JaGeo commented Jan 6, 2023

Just adding this here:

def coords(self) -> np.ndarray: # type: ignore

This name is a bit unfortunate. If as_dict as inherited from PeriodicSites is then used, "coords" (typically fractional coordinates but now cartesian ones due to the overloading) is used and this might lead to the other problems with from_dict and as_dict for PeriodicNeighbors (besides the dict issue for the species).

@JaGeo
Copy link
Member Author

JaGeo commented Jan 6, 2023

In any case, I am happy that the issue is fixed now. Thanks @shyuep @janosh

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