-
Notifications
You must be signed in to change notification settings - Fork 11
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 import of local XYZ files #108
base: dev
Are you sure you want to change the base?
Conversation
newMaterial.cleanOnCopy(); | ||
|
||
Made.tools.material.getBasisConfigTranslatedToCenter(newMaterial); | ||
this.props.onSubmit([newMaterial]); |
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 function does the job, but it's a bit too long. Here's what we can do:
- Isolate the Math-related portions to Made
- Create one more default material config in Made to have a simple cubic lattice and import here
- Keep only 5-10 lines here with clear naming - e.g.
determineMaxInteratomicDistance(material)
etc.
// Line 150:17: Expected 'this' to be used by class method 'renderFooter' class-methods-use-this | ||
// renderFooter() { | ||
// return null; | ||
// } |
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.
We can remove these, I guess, no?
material: PropTypes.object, | ||
}; | ||
|
||
export default DefaultImportModalDialog; |
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.
We should consider a test for this functionality, similar to https://github.com/Exabyte-io/materials-designer/tree/dev/tests/cucumber/features/menu and including some of the fixtures you provided earlier in this PR
Summary
This PR adds a feature to import local XYZ files. Partially based on the implementation in #26 with some subsequent cleanups and reusing objects from existing libraries.
Closes #26.
Example
An example input was taken from https://www.gloriabazargan.com/blog/visualizing-molecules:
One needs to remove the first two lines to make it work with the current version of the parser:
Screenshot