-
Notifications
You must be signed in to change notification settings - Fork 7
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
Fixes #32
Merged
Merged
Fixes #32
Conversation
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
In principle, we can also not define the kinds, in that case it is up to the plugin to use the get_kinds() method of the StructureData to define kinds.
missing: PropertyCollector and properties.
Need more profiling for low-atoms systems, where it seems orm is better
Missing: deactivate this automatism.
used to deactivate the automatic kind generation.
This is provided in temporary way in order to make easier to migrate the plugin gradually to this new Data. In a first step, we should use this method anytime the plugin uses the StructureData. Then add the properties setting.
- Adding some bugfixing for the empty StructureData init.
This is implemented following the pydantic PR for aiida-core: aiidateam/aiida-core#6255
adding the `charges` properties, in the same way as we have the cell and pbc: hard-coding the getter and setter methods. For now, no data validation is there.
Added the map_kinds method, which return the mapping for the kinds as contained in the sites attribute.
attribute from the StructureData class, nothing else changed) Added also the charges in the get_ase method.
- code refactored: now `StructureData` and `Site` classes are in separated files, as well as the utils; `Kind` class is removed - `Site` class now contains the properties: `symbol`, `position`, `mass`, `charge`, `magnetization`, `kind_name`; `kind_name` should be removed. The properties are defined via the `property` decorator - `from_ase`, `to_ase` methods are added - `from_pymatgen`, `to_pymatgen` methods are added (**TOBE fixed to add also the magnetization**) - `from_file`, `to_file` methods are added. They rely on ASE `io.read` and `io.write` functions. - the `orm.StructureData` (the old one) now has a method `to_atomistic` - the `utils.py` file contains also the `to_kinds` and `get_kinds` functions, to automatically generate kinds. The user should only use the `get_kinds` function. **TOBE refined: kind names, and remove the other kinds methods from the StructureData class.** - the `StructureData` constructor now works in this way: we provide the pbc, cell. Then we should use the `append_atom` method afterwards. **TOBE discussed, I guess we cann add lists contaning site-wise value for properties** - slicing of structure data: defined the __getitem__ method, to obtain a sliced structuredata instance from the initial one. - TOBE added: `to_supercell` method.
gonna change this by providing the possibility to provide list of sites (each of them is a dictionary), in the same format as they are represented in the database
StructureData class.
both inheriting from StructureDataCore. Added properties: - charge - magmom Relevant added methods: - from/to ASE/Pymatgen - to_legacy - to_structuredata - to_mutable_structuredata Added single page for API tutorial. Added tests for basic functionalities of both Structure Classes.
are then stored as [magmom,0,0]
Mutability is improved by removing all the setter methods, both in StructureDataCore and Site classes. Moreover, lists and tuples are returned as np.array with flags.writeable=False, meaning that we cannot even modify the internal arrays/lists. Other minor changes: - Now in StructureDataCore we have to define the pbc, cell and sites keywords to initialise it (and so the other subclasses), this is helpful to then document the inputs. - `get_kinds` routine fixed to work also with magmoms (arrays) - docu and tests updated with respect to these changes.
removing mutable attribute in Site class adding a get_global_properties method in StructureDataCore, not used now but in the future to have a list of the properties in the database (not only attached to the single sites), to make easy to query wrt a property.
Providing full flexibility in the StructureDataMutable while preserving same data structure of StructureData. - adding the parent and index when we initialise the Site class (i.e. when we access structure.sites). This is helpful to be able to change directly properties in the StructureDataMutable class. - in the same direction, we implemented the ObservedArray class which basically allows to trigger the setter methods of arrays/lists even if we modify only one element (for example: structure.sites[0].position[0] = 5). In this way, changes are written into the structure._data, which represents the real data stored in the instance. `get_kinds` method now is stable. Fixing pymatgen problems with oxi_state and magmom.
update of the pytests.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.