Git Product home page Git Product logo

depper's People

Contributors

ebakoba avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

depper's Issues

Dependencies builder is order sensitive

I am trying to use to this repo but i have encountered a bug or perhaps i am misusing it.

For example, I have 3 dependers named machine1, machine2 and machine3 and 2 dependees named network1, network2. If i enter the elements in order, dependers before dependees, then it works as expected:

    let mut dependencies_builder = Dependencies::builder()
        .add_element("machine1".to_string(), vec!["network1".to_string()])
        .add_element("machine2".to_string(), vec!["network1".to_string()])
        .add_element("machine3".to_string(), vec!["network2".to_string()])
        .add_element("network1".to_string(), vec![])
        .add_element("network2".to_string(), vec![]);

outputs as expected:
Tranches: [["network2", "network1"], ["machine1", "machine2", "machine3"]]

However, if the elements are entered in any other order the results are unpredictable and erroneous. In this example the dependees are inserted before dependers.

    let mut dependencies_builder = Dependencies::builder()
        .add_element("network1".to_string(), vec![])
        .add_element("network2".to_string(), vec![])
        .add_element("machine1".to_string(), vec!["network1".to_string()])
        .add_element("machine2".to_string(), vec!["network1".to_string()])
        .add_element("machine3".to_string(), vec!["network2".to_string()]);

outputs:
Tranches: [["network2", "network1"], ["network1"], ["machine2", "machine1"]]

If the first example is how it should be used then i would need to start analyzing each entry and their dependencies myself and i feel like that should be covered by the repo instead

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.