Giter VIP home page Giter VIP logo

Comments (9)

danielhuppmann avatar danielhuppmann commented on May 26, 2024

See https://github.com/iiasa/ariadne-intern-workflow/blob/31cfbc2f9bf89b498a301b65cce56a585343a9c2/.github/workflows/validation.yml#L28 for a real-world use case.

from nomenclature.

phackstock avatar phackstock commented on May 26, 2024

Should be reasonably quick to implement. Who should take this one myself or @LauWien since she did the CLI originally?

from nomenclature.

danielhuppmann avatar danielhuppmann commented on May 26, 2024

I created the issue more as a reminder for the medium-term development. Let's leave this until next year...

from nomenclature.

danielhuppmann avatar danielhuppmann commented on May 26, 2024

On further thought: currently, nomenclature.testing.assert_valid_structure() only validates the variable and region dimensions.

Going forward, the behavior should be as follows:

  • by default, all sub-folders in definitions are validated
  • if a value for dimensions is given explicitly, (only) these dimensions are validated

This default is more cautious than only validating default dimensions because additional dimensions may be added over time in a project - and the user adding these dimensions may forget to add these new dimensions to the tests.

from nomenclature.

luciecastella avatar luciecastella commented on May 26, 2024

Hello!
I think my implementation works now.
A few questions still to make sure it's correct:

  • Should the non-default dimensions only be the variables on an IamDataFrame (variable, scenario, ...) or could it be a random name? I figured it could be anything because of issue 68 but let me know.
  • Now we can pass any number of arguments in the terminal like this "nomenclature validate-project path/myproject variable region scenario". Is it fine like this or do you prefer that the user enters the list in the form "['variable','region',...]"?
  • I have a test with an empty dimension, a test working fine with a dimension '"scenario" and one also working fine with a random dimension "foo". Do I need more?
  • Are there other steps for this issue?

Thank you!

from nomenclature.

danielhuppmann avatar danielhuppmann commented on May 26, 2024
  • Should the non-default dimensions only be the variables on an IamDataFrame (variable, scenario, ...) or could it be a random name? I figured it could be anything because of issue 68 but let me know.

As a first PR, I would only add the feature to pass a list of dimensions via the CLI (and not worry about #68 yet).

  • Now we can pass any number of arguments in the terminal like this "nomenclature validate-project path/myproject variable region scenario". Is it fine like this or do you prefer that the user enters the list in the form "['variable','region',...]"?

I would expect a CLI like

nomenclature validate-project . --dimensions=["variable", "region"]

so that we can add more options later.

  • I have a test with an empty dimension, a test working fine with a dimension '"scenario" and one also working fine with a random dimension "foo". Do I need more?

As mentioned by @phackstock yesterday, it would be good to have one passing and one failing test. To make it easier for the reviewer, it would be useful to clearly name the test-data folders like "cli-dimension-failing" (with a dimension where the validation fails because something is not correct with the specifications) and a "cli-dimension-passing". In both cases, the dimension could be called "foo".

  • Are there other steps for this issue?

Better to keep the PR as simple as possible, then discuss and review, merge - and then start another one with a next set of features.

from nomenclature.

luciecastella avatar luciecastella commented on May 26, 2024

OK thank you very much! Now I am stuck... Do either of you know how to pass a list as an option in CLI?

from nomenclature.

phackstock avatar phackstock commented on May 26, 2024

Looking at the click documentation quickly, this looks like a promising start https://click.palletsprojects.com/en/8.1.x/options/#multiple-options.
Also when you open a PR you can choose to open it as a draft PR which might be a good idea in this case, then we can discuss more closely to the code. Once it's all ready you set it to "ready for review". https://github.blog/2019-02-14-introducing-draft-pull-requests/

from nomenclature.

luciecastella avatar luciecastella commented on May 26, 2024

Great thank you!!

from nomenclature.

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.