Skip to content

Additional call syntaxes #5

Description

@cliffckerr
# Provide as function
import subenv
env = subenv.Env() # use default python interpreter

def my_func():
  import starsim as ss
  sim = ss.demo()
  return sim

sim = env(my_func) # or env(sim=my_func).get('sim')
# Execute from within the file
import subenv
env = subenv.Env()

# <start>
import starsim as ss
sim = ss.demo()
# <stop>

env.run_lines(start='<start>', stop='<stop>')
sim = env['sim']

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions