Giter VIP home page Giter VIP logo

Comments (7)

davidwaroquiers avatar davidwaroquiers commented on July 26, 2024 3

Just to complement, here is the diagram of the TaskDoc model. Found this erdantic package (https://github.com/drivendataorg/erdantic), which is quite nice.

taskdoc

from emmet.

munrojm avatar munrojm commented on July 26, 2024

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.

munrojm avatar munrojm commented on July 26, 2024

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.

davidwaroquiers avatar davidwaroquiers commented on July 26, 2024

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.

davidwaroquiers avatar davidwaroquiers commented on July 26, 2024

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.

davidwaroquiers avatar davidwaroquiers commented on July 26, 2024

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:
image

with the image in this case (can be zoomed of course):
image

This is done using autodoc_pydantic_model_erdantic_figure = True in conf.py.

from emmet.

munrojm avatar munrojm commented on July 26, 2024

Thanks for this, I will try and add it in this week.

from emmet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.