Projects

Contents

Project class

class arepy.scripy.project(name)

Project class

Variables
  • dirSim (str) – Absolute path to the simulation directory

  • sims (dict) – Set of basic simulation settings

Note

The simulation directory path has to be always specified. It is used by the bash script in the run.sh file to check whether the current directory belongs to some project.

init()

Initial settings of a project

This method should be overloaded by any derived project classes and it should consist following two settings:

  1. A path to the simulation data.

  2. Basic settings of the simulations

A minimalistic setting will look like:

# Simulation directory of a project
self.dirSim = "/simulation/directory"

# Setup of a new simulation
self.sims['001'] = {
    'dir': self.dirSim+'/subdirectory',
    'name':'first',
    'setup':'first',
    'job':{'nodes':1,'proc':40,'time':'1:00:00','type':'fat'},
    'units':{'length':apy.const.pc,'time':apy.const.yr},
    'opt':{}
}
getUnits(simID)

Get units of a simulation

Parameters

simID (int) – Simulation ID

Returns

Units

Return type

arepy.units

getJob(simID)

Get job settings of a simulation

Parameters

simID (int) – Simulation ID

Return dict

A dictionary with job settings

getSimulation(simID, **nopt)

Get simulation object

Parameters
  • simID (int) – Simulation ID

  • nopt (dict) – Simulation options

Returns

Simulation object

Return type

arepy.files.simulation

getSetting(simID, name)

Get simulation settings

Parameters
  • simID (int) – Simulation ID

  • name (str) – Name of the setting

Return dict

Simulation settings

initProj(name)

Initialization of a new scripy project

Parameters

name (str) – Name of the project in a format: [a-zA-Z0-9]+

This method can be triggered via command line:

apy --init-project myproject
initSetup(name)

Initialization of a new scripy setup

Parameters

name (str) – Name of the setup in a format: [a-zA-Z0-9]+

This method can be triggered via command line:

apy --init-setup mysetup
initPlot(name)

Initialization of a new scripy plot

Parameters

name (str) – Name of the plot in a format: [a-zA-Z0-9]+

This method can be triggered via command line:

apy --init-plot myplot
initScript(name)

Initialization of a new scripy script

Parameters

name (str) – Name of the script in a format: [a-zA-Z0-9]+

This method can be triggered via command line:

apy --init-script myscript