-
Notifications
You must be signed in to change notification settings - Fork 0
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
Provide a shortcut to ase.build #66
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# coding: utf-8 | ||
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department | ||
# Distributed under the terms of "New BSD License", see the LICENSE file. | ||
|
||
import unittest | ||
|
||
from ase import build | ||
|
||
from structuretoolkit.build import ase | ||
|
||
|
||
class TestAse(unittest.TestCase): | ||
def test_build_shortcut(self): | ||
self.assertIs(ase, build, msg="Our link should be a simple shortcut.") | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liamhuber Can you extend the test a bit, to test the typical functionality of the
ase.build
module? My fear is that ASE might change their functionality at some point and we only notice it by users complaining. For the same reason I added tests for the most commonly used functions frompyscal
in https://github.com/pyiron/structuretoolkit/blob/main/tests/test_pyscal.pyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do this. Right now the promise in the documentation, the implementation in the code, and the test are all in full alignment: we are simply providing a shortcut to another module,
structuretoolkit.build.ase is ase.build
.Before this change, users had to keep their
ase.build
calls up-to-date with ase; after this changes users need to keep theirase.build
calls (viastk.build.ase
) up-to-date with ase. No changes here. If they complain all we need to do is let them know ase has updated and the rest is on them; if they want to downgrade their version of ase to keep their existing code working there's nothing that stops them -- all this does is link to the ase library.First, I see this as a fundamentally different case. These tests check the behaviour of the public-facing methods
stk.common.ase_to_pyscal
,stk.analyse.get_steinhardt_parameters
,stk.analyse.get_centro_symmetry_descriptors
,stk.analyse.get_adaptive_cna_descriptors
,get_diamond_structure_descriptors
andstk.analyse.get_voronoi_volumes
(btw I see nowstk.analyse.find_solids
is missing!), all of which are functions with actual bodies that we implement instr.common
andstk.analyse.pyscal
. Therefore it's right and good that we test them.In contrast,
stk.build.ase
has zero content from our end. Any tests would just be some sort of duplication of ase tests and are unnecessary. We have no interface or promises to maintain other than that we are giving access to ase, which is what's tested.Second, I think it would offer very little benefit. If we are testing just "common" cases (e.g.
ase.build.bulk
), then we're going to see tests fail elsewhere anyhow, since we usease.build
everywhere anyway! So testing standard calls would just be dead weight.So, I am very much against expanding the tests beyond this -- BUT, I think it's perfectly fair to ask whether we want to provide a shortcut at all! The "pro" is that we can have a single point of import for a bunch of examples/tests/etc., which is great for lazy people like me. The "cons" are that we may come across as "stealing" ase functionality (I think this is not too bad since we explicitly call it
build.ase
) and your fear that users may mistakenly think we're the ones responsible forase.build
staying backwards-compatible.I wanted to get your eyes on this in case you felt we should reject the idea in its entirety. I'm in favour of merging it (obviously), but I would accept your veto with zero hurt feelings.