Giter VIP home page Giter VIP logo

Comments (4)

danielhuppmann avatar danielhuppmann commented on May 27, 2024 1

Sounds like a good strategy, thanks!

from nomenclature.

danielhuppmann avatar danielhuppmann commented on May 27, 2024

The validation is happening as part of an iteration over all file names anyway, so why not catch the error that happens in the parsing of a particular file, add the message "The following occurred in file {file}: {error.message}", then raise the error again?

from nomenclature.

phackstock avatar phackstock commented on May 27, 2024

Good point, but I don't think that it's the cleanest way to intercept our own errors and then pop something on. Simply saving the file name does not cost that much memory.
Additionally, there is a use case where having the file name inside the RegionAggregationMapping is rather useful. When checking if there are any model collisions for the given region mappings. Let's say we have two mappings both for model_a, we only realize the error once we are reading the second file that defines a mapping for model_a. However, I would argue its important for the user to know both conflicting files. If we have it saved inside the RegionAggregationMapping that piece of information is easy to come by.

from nomenclature.

phackstock avatar phackstock commented on May 27, 2024

Perfect, I'll open a PR as soon as I have something

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.