Code Monkey home page Code Monkey logo

depgraph's People

Contributors

njwilson23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

depgraph's Issues

Add circular dependency detection

DependencyGraph methods should be able to detect cases in which dependencies are circular, as in

graph.add_relation(a, (b,))
graph.add_relation(b, (c,))
graph.add_relation(c, (a,))

or even

graph.add_relation(a, (a, b, ...)

In this case, probably makes sense to raise something like a CircularDependencyError exception.

buildall() does not work for simplest graph

i, dep = queue.pop(0)
should this have roots added to the list? E.g.:

            ...
            i, dep = queue.pop(0)
            marks[dep] = i
            ...

Otherwise I'm not seeing any code that would produce items that don't have any parents?
Simple code:

from depgraph import Dataset, buildall
parent = Dataset('parent-does-not-exists', tool=None)
child = Dataset('child-does-not-exists', tool=None)
child.dependson(parent)
for stage in buildall(child):
    for dep, reason in stage:
        print("Building {0} with {1} because {2}".format(dep.name, dep.tool, reason))

Output only builds child, not the parent:

Building child-does-not-exists with None because the dataset doesn't exist

Implement parallel builds

This is critical. Parallel builds should permit datasets that require a build and don't depend on each other to be constructed at once. This might work by having a DependencyGraph.parallel_needsbuild method that returns lists of Dependencies that can be built. Alternatively, could try something concurrent where a channel is filled with eligible builds as the dependency graph is traversed.

It is probably best to leave resource allocation to the function managing the build, but each dependency could have an attribute specifying the number of threads that can be used to build it.

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.