GithubHelp home page GithubHelp logo

Comments (3)

nsbgn avatar nsbgn commented on June 14, 2024

The commits over the past few days, addressing the improvement of the textual representation of our data structures (4349a30, 5bd551c, a0a9fb9, bb61697), type-annotated parsing (9b83455, e144146) and enabling more succinct test cases (4487c79, b75f9f1, 994d31a) all had as goal to create order in the chaos.

The next step is to move errors to the modules that are relevant to them.

Also, instead of clumsily annotating the expressions in which type errors occur, we can wrap a type error in an expression error. We can still test which type error is raised by inspecting the __cause__ attribute set when you use raise from (see https://stackoverflow.com/questions/24752395/python-raise-from-usage). For unittesting, we can write an assertRaisesChain that wraps assertRaises used as a context manager (see https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises).

This approach also allows us to raise another wrapped error for errors that occur during the primitive expansion of an expression containing a composite operator.

from transforge.

nsbgn avatar nsbgn commented on June 14, 2024

More thoughts:

  • Every relevant class (Operator, TypeSchema) gets a method simply called validate() that gives explicit guarantees as to what assertions the user may make if it completes without error.
  • There should be a WorkflowError exception that tells you on which attachment of input and output an error occurred.
  • visual_test files should be present that aren't for unit testing but just for checking how the errors look when they are raised.

from transforge.

nsbgn avatar nsbgn commented on June 14, 2024

Current issue can be closed with 1e232ab. visual_test files aren't made yet but that's an idea for later.

from transforge.

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.