-
Notifications
You must be signed in to change notification settings - Fork 27
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
Enable installing the python helpers with pip #96
Conversation
@rosecers do you think you could give this a look? |
A few thoughts.
|
That's only true for the command line version. The function supports an
Completely agree, but I'm not sure we want to tackle this in this repository, and definitively not in this PR =) This was the goal of our initial idea with @rosecers for the chemistack proposal, and seems to be related to what I understand M-stack would be. The issue here is that there are a lot of different ways one could want to create the map part of chemiscope. While at COSMO we use SOAP/librascal + and a few different mapping algorithms, there is no reason to marry chemiscope with these specific descriptors and mapping algorithms if we want it to be used by the widest variety researchers. We could create a prototype chemistack easily using notebooks, @rosecers already has one prototype using matplotlib to display the map. This also links into the FlowingSOAP idea at materials cloud. Overall I think we should have a meeting/brainstorming session to decide what we want to do here. There is also the ASAP tool to so something like this, so we could also help and work with them instead of re-inventing our own wheel.
I think I prefer having the same name in pip and in code (so |
This PR I agree, this repo we should. I don't mean that the analysis should be part of this repo, but that we should make converting the output of the analysis into a chemiscope as seamless as possible. So M-stack is a separate discussion, here I just wanted to stress that the process of getting an xyz and an analysis output into a chemiscope could be easier.
My thinking is probably less informed than yours. To me it's not the end of the world to have a pip chemiscope that differs from npm chemiscope but perhaps someone better informed has discussed the case and come up with good practices? |
Read the json file to access it in setup.py, and use setuptools to set chemiscope.__version__ accordingly
Oh, right 😄. Completely agree with this, do you have specific pain points that could be improved? Or an ideal workflow that we could try to enable? By analysis output, do you mean a in-memory numpy array, or some data save on the disk? |
Oh, right 😄. Completely agree with this, do you have specific pain
points that could be improved? Or an ideal workflow that we could try to
enable?
By analysis output, do you mean a in-memory numpy array, or some data save
on the disk?
I think ideally we should keep the dual workflow with a function that is
mirrored by a command-line utility. People from "my generation" still have
an instinct to go full bash onto postprocessing.
So I think we want to be able to easily combine structures (here having
something that can be read by ASE or an Atoms list seem to cover quite some
grounds) and arrays of values (that maps easily into column files) or
dicts.
One thing that often bugs me is that I want to drop info from the ASE file
so there could also be a switch that allows you to drop those fields.
I don't know if you get the idea or want to discuss a more formal API/set
of use cases.
|
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.
This in general looks good -- there were a few places that I have questions and suggestions, but there's nothing prohibitive.
parser.add_argument( | ||
"--description", default="", type=str, help="description of the dataset" | ||
) |
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.
Could we also make it possible to load the description from a text file? Seems likely that this will be a very long argument.
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.
The command line script is more for quick & dirty JSON generation. I would rather make people use the python function directly instead if the command line script is not enough for them.
if args.only_structures and args.cutoff is not None: | ||
raise Exception("--only-structure can not be given with --cutoff") |
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.
Should this be a warning, rather than an exception?
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.
Why? It is bogus, there is no obvious way to recover (should cutoff or only-structure take precedence?), and the user can correct this easily by changing the command line invocation.
I think I get the idea, that should already be possible within python with |
So I went a bit ahead and added unit tests for most of the python code. This should help to improve it later, but makes this PR a bit large. I'll try not to add anything else to it =) |
This comment has been minimized.
This comment has been minimized.
Everything should be addressed! |
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.
Looks good to me. On the record, I'd like us to revisit in the future the decision to omit unexpected/incomplete entries.
As soon as we have support for them (#38), I would agree! See also #97 (comment) on this subject. |
Fix #94
One unresolved question is what should be the name of the package. I went with
chemiscope
, but this might create a bit of confusion with the npm/javascript chemiscope package. An alternative would bechemiscope-input
, but then if/when we create a jupyter plugin for chemiscope it would have to live in a different package.