Skip to content
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

Feature/mutable helper class #22

Merged
merged 24 commits into from
Jul 17, 2024

Conversation

mikibonacci
Copy link
Collaborator

@mikibonacci mikibonacci commented Jul 17, 2024

New StructureData and StructureDataMutable
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.

This will solve #9, #10, #17,

mikibonacci and others added 23 commits March 2, 2024 21:24
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
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.
@mikibonacci mikibonacci requested a review from agoscinski July 17, 2024 13:14
@agoscinski agoscinski changed the base branch from main to develop July 17, 2024 13:47
@agoscinski agoscinski changed the base branch from develop to rm-old July 17, 2024 13:50
@agoscinski agoscinski changed the base branch from rm-old to main July 17, 2024 13:56
@agoscinski agoscinski changed the base branch from main to rm-old July 17, 2024 13:56
Copy link
Collaborator

@agoscinski agoscinski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You now have docs/docs, I feel lie this is a problme

@agoscinski agoscinski marked this pull request as ready for review July 17, 2024 15:19
@agoscinski agoscinski changed the base branch from rm-old to develop July 17, 2024 15:19
@agoscinski agoscinski merged commit cbd49b5 into aiidateam:develop Jul 17, 2024
0 of 3 checks passed
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.

2 participants