Giter Site home page Giter Site logo

Comments (15)

christian-rli avatar christian-rli commented on July 30, 2024 2

I agree with @MGlauer . The tool to handle and integrate metadata is omi. it's even in the name :)
oem-codegen seems like a reasonable name. Just to add another candidate here: oem2orm looks somewhat self-explanatory to me, but i might have been looking at acronyms for too long in my youth.

from oem2orm.

MGlauer avatar MGlauer commented on July 30, 2024 1

So I'm not sure if this feature should be part of OMI or oedialect.
Please discuss and improve this workflow!

IMO it should be an independent tool altogether or a dialect in OMI. But definitely not part of oedialect: oedialect is a facility to connect and communicate with an existing database. Changing things on the client-side is not part of any use-case. oedialect is a tool that is imported in a project to develop a tool A. Users of A have to install the additional oem-codegen functionality even though this has no bearing for the functionality of A. Users might want to generate an ORM schema but not use it with the OEP - but for their own, local database. We would limit the user base of md2orm by linking unnecessarily close to oedialect.

If it is part of OMI, there should also be a parser that tries to parse a given metadata schema and generates the corresponding metadata file (i.e. add an ORM dialect), because this is what OMI does. If we do not do this, I would argue for an independent tool.

And maybe rename md to oem (open energy metadata) as md might be associated with well-known markdown format. What about oem-codegen, as the proposed functionality is rather similar to sqlalchemy-codegen?

md2orm could be it's own command line application similar to OMI:

oem-codegen -t oep-1.4 medadata.json > schema.py

from oem2orm.

Ludee avatar Ludee commented on July 30, 2024 1

i like oem2orm. That's what it is.
Is it ready for use?

I have an issue over there where I create metadata an want to upload it.

Can you please have a look @jh-RLI

from oem2orm.

henhuy avatar henhuy commented on July 30, 2024 1

oem2orm - very good!
I don't know how much you tested it?!
Think we should test it with some more metadata and then it's ready

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024 1

I have already tested this with several metadata files. I'm now testing again if everything works with the oedialect and then we can do the package release.

from oem2orm.

henhuy avatar henhuy commented on July 30, 2024 1

I think you could have made typer optional (check if import fails) and use input if not, but anyway... no problem for me.
I would be glad to see it on PyPI!
Could you add me to authors? Thx

from oem2orm.

Ludee avatar Ludee commented on July 30, 2024

Similar toolchain for Data Download:

2020-03-09_MD2OEP-download_v0 2

  1. Register OEP schemas using saio
  2. Retrieve ORM from OEP using saio
  3. Download data using oedialect
  4. Create ERM using ERAlchemy
  5. Download metadata using oedialect

from oem2orm.

Ludee avatar Ludee commented on July 30, 2024

So I'm not sure if this feature should be part of OMI or oedialect.
Please discuss and improve this workflow!

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

I also think it would be practical if you could use the new tool on an independent basis. But I think the integration into OMI is useful to provide the user with all tools for metadata integration.

I like the idea of renaming the tool to oem-codegen .

I do not yet fully understand the parser part. The metadata itself should be created manually I think.
Or should the metadata string be validated by that?

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

For the technical documentation of md2orm:
The tool is created as cli tool. This is implemented with Typer. All functions can also be imported individually.

To use it as a CLI tool a virtual environment (e.g. anaconda) should be created and all packages (requirements.txt) must be available there.
To run md2orm as a CLI tool the CMD must be started, the environment must be started and then the following command must be executed
python md_to_orm.py --engine=postgresql --database=name??? --host=localhost --port=5432 --log-level=debug --from-folder test_files

--database=name??? must be customized with the desired database name. If no value is set here, all tables will be created in the default postgresql database postgres.

The command shown above for md2orm uses the available test data from the test_files folder.

If the OEdialect is to be used, then the following values must be set --engine=postgresql+oedialect and --host=https://openenergy-platform.org/

To see all the options that can be used in md2orm you can use the CMD command:

python md_to_orm.py --help

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

@henhuy as you mentioned in the past there are some data type issues with the oedialect. I moved the development to GitHub here. I removed the typer feature for convenience :). Recently I implemented the oep-restrictions. I would like to release this on PyPI.
@Ludee Do we have a OEP PyPi account?

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

That would be possible, maybe I'll even put it back in. I have removed Typer because it has created confusion about how the tool is used. Still a great feature IMO. I will let you know when the release is done.
Sure, I'll add you as author.

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

https://github.com/OpenEnergyPlatform/oem2orm

from oem2orm.

henhuy avatar henhuy commented on July 30, 2024

We can close, right?

from oem2orm.

jh-RLI avatar jh-RLI commented on July 30, 2024

Yes! But maybe we should document the diagrams that @Ludee created. I think he got them saved somewhere, but I'll put them in our "cloud" for now and then close this Issue.

from oem2orm.

Related Issues (17)

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.