Comments (7)
Just to complement, here is the diagram of the TaskDoc model. Found this erdantic package (https://github.com/drivendataorg/erdantic), which is quite nice.
from emmet.
I think you are generally right about individual property methods with respect to how many would need to be added. However, if a property like magnetic_density
is sufficiently important for people, I would argue a dedicated root-level attribute to get the data should probably be there. My guess is the list of those may not be super large, in which case your first proposal might be okay.
For your second idea, do you envision people using the helper method to effectively search the nested schema for mention of some property?
from emmet.
Just to complement, here is the diagram of the TaskDoc model. Found this erdantic package (https://github.com/drivendataorg/erdantic), which is quite nice.
Thanks for posting this, I really like it.
from emmet.
Just to complement, here is the diagram of the TaskDoc model. Found this erdantic package (https://github.com/drivendataorg/erdantic), which is quite nice.
Thanks for posting this, I really like it.
Yes, it even has tooltips showing the full docstring when you hover on a box (if it's an svg output). It could definitely be used almost directly in the emmet documentation.
from emmet.
However, if a property like
magnetic_density
is sufficiently important for people, I would argue a dedicated root-level attribute to get the data should probably be there. My guess is the list of those may not be super large, in which case your first proposal might be okay.
Right, I guess some additional dedicated root-level attributes would be ok. Also considering the fact that if you want to query on those, the second idea with one python-property method or method per material-property or one method for several property, this cannot be used to query in the database as it is obviously not in it.
For your second idea, do you envision people using the helper method to effectively search the nested schema for mention of some property?
The idea would be to implement a "shortcut" for some properties. (stupid) Example for the magnetic_density would be:
class TaskDoc(StructureMetadata, extra="allow"):
...
def get_property(self, prop_name):
if prop_name == "magnetic_density":
return self.output.calcs_reversed[0].output.mag_density
Again, this does not allow querying on that (e.g. give me all the materials for which the magnetic density is larger than X) but at least allow to get it more easily than using the full "path" in the nested schema. It still raises the question of which property shortcuts to implement anyway.
from emmet.
Just to complement, here is the diagram of the TaskDoc model. Found this erdantic package (https://github.com/drivendataorg/erdantic), which is quite nice.
Thanks for posting this, I really like it.
Also just to mention that this can also be directly integrated within the api documentation by sphinx (I have seen mkdocs is used for emmet-core).
I thought I'd mention it as I think it would be very beneficial to have these entity relationship diagrams in the documentation. You can find one example on our newly released atomate2-turbomole add on, e.g. here https://matgenix.github.io/atomate2-turbomole/api/atomate2.turbomole.schemas.task.html#atomate2.turbomole.schemas.task.TaskDocument, in which there is a dropdown to show the diagram:
with the image in this case (can be zoomed of course):
This is done using autodoc_pydantic_model_erdantic_figure = True
in conf.py.
from emmet.
Thanks for this, I will try and add it in this week.
from emmet.
Related Issues (20)
- [Feature Request]: Add missing `py.typed` file
- [Feature Request]: Better handling of parsed trajectory in VASP calculations HOT 4
- Potential issue with change in monty deserialization HOT 2
- Pydantic 2.5.0 breaks `from_vasp_files` HOT 1
- [conda package] missing dependence on `custodian` HOT 2
- Bug: The `.as_dict()` method on `CrystalSystem` is not Monty compatible HOT 6
- Serialzation issues with ValueEnum HOT 1
- Bug: Q-Chem's `TaskDoc.from_directory` does not work with a custom directory
- Bug: Q-Chem's `TaskDoc.from_directory` does not properly parse enthalpy or entropy (or frequency modes)
- Q-Chem Bug: There should not be a check on supported basis sets and functionals HOT 15
- Bug risk in CLI
- Bug: Information is lost on Pydantic `.model_dump()` in `TaskDoc` HOT 1
- Bug: Wrong `run_type` report on r2SCAN run HOT 3
- Changing how `task_types` are determined HOT 4
- Q-Chem data is not always valid
- [Feature Request]: Remove strict version pin on pymatgen HOT 14
- [Help Wanted]: Can not parse trajectory of VASP optimization directory HOT 9
- Bad force unit in VASP `OutputDoc`
- [Bug]: Phonon docs fail to JSON serialize with `json.dump(cls=MontyEncoder)`
- [Bug]: emmet-core pymatgen pin HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emmet.