Git Product home page Git Product logo

smttask's People

Contributors

alcrene avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

tcwhalen

smttask's Issues

Migrate to Pydantic v2

Pydantic v2 has may improvements over v1.
In particular it should make #1 obsolete, since there are no json_encoders in v2.

Most of the work for this actually needs to be done in scityping #2.

Support pickling tasks

Although pickling simple minimal tasks sometimes works, this a) is untested and b) fails as soon as inputs or outputs involve dynamically created types (which are quite common in smttask). Thus we need

  • Support for pickling tasks with dynamic types. These may be introduced via
    • task generators (task_generators.py)
    • multi-outputs (see base.TaskOutput.__init_subclass__)
  • Comprehensive tests
    • Include all types of tasks (esp. all generated types) and both single- and multi-output tasks.
    • Test multiprocessing where:
      • Tasks are passed as arguments
      • Tasks are returned as results
      • Tasks are executed in the subprocess, and their result is returned.

The main use case I see for supporting pickle is to allow parallelizing task execution with the multiprocessing module.

Relevant SO question: Pickling dynamically generated classes?

When serializing a Pydantic model, use its own json encoders

A user of Pydantic would reasonably expect that if they use a Pydantic type as Task input, the json encoders for that type would be used to encode its attributes. At present this is not the case: since Task inputs are combined into one big Pydantic BaseModel, the global encoder dict defined in smttask.typing.json_encoders is always used. Beyond being unexpected, this has at least two drawbacks:

  • One needs to pollute the global json_encoders dict with all possible custom types.
  • It is not possible to define different JSON encoder mappings for different task inputs.

Relevant test is added here.

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.