Code Monkey home page Code Monkey logo

Comments (4)

dotsdl avatar dotsdl commented on July 4, 2024

Ah...I think this is one of perhaps quite a few cases where we expect Containers should work a certain way, but due to their simple __init__() rules, probably don't yet. I think it's worthwhile to lay out all the ways we can think of for initializing Containers, both from scratch and when regenerating them. I could add a fix that includes this case, but I'm curious if we can try and identify any others, too, to make it less of a band-aid and more of a settled specification.

For generation, these should work:

  1. Sim('name'), where 'name' is not an existing file or directory in the current directory
  2. Sim('name'), where 'name' is an existing directory without any state files already present
  3. Sim('name', location='somedir'), where 'name' is not an existing file or directory in 'somedir'
  4. Sim('name', location='somedir'), where './somedir/name' is an existing directory without any state files inside

For regeneration, these should work:

  1. Sim('name'), where there exists only one Sim state file inside './name'
  2. Sim('name/Sim.<uuid>.h5'), where there need not be only a single Sim state file in './name'

Everything else should fail with an exception indicating that no state file was found. I think that will tie up all the possibilities. Am I missing something?

from mdsynthesis.

dotsdl avatar dotsdl commented on July 4, 2024

This has been addressed in datreant/datreant#14. The location keyword has been ditched in favor of using the first argument to the constructor to specify the statefile location in every case.

For generation, these will all work:

  1. Treant('treant'), where 'treant' is not an existing file or directory path
  2. Treant('treant'), where 'treant' is an existing directory without Treant state files inside
  3. Treant('/somedir/treant'), where 'treant' is not an existing file or directory in 'somedir'
  4. Treant('/somedir/treant'), where 'treant' is an existing directory in 'somedir' without any Treant state files inside
  5. Treant('somedir/treant', new=True), where 'treant' is an existing directory in 'somedir' with or without an existing Treant statefile
  6. Treant('/somedir/treant'), where 'treant' is an existing directory in 'somedir' with other types of Treant files inside (such as a Group)

For regeneration, these will all work:

  1. Treant('treant'), where there exists only one Treant state file inside 'treant'
  2. Treant('treant/Treant.<uuid>.<ext>'), where there need not be only a single Treant state file in 'treant'

from mdsynthesis.

cing avatar cing commented on July 4, 2024

Well done! You're really putting in some awesome work on this.

from mdsynthesis.

dotsdl avatar dotsdl commented on July 4, 2024

@cing thanks! Getting close to a new release, so trying to tie up important issues.

from mdsynthesis.

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.