Skip to content
ibackus edited this page Aug 7, 2015 · 21 revisions

Home

Installing diskpy

1. Dependencies

Make sure you have the following packages installed:

  • numpy
  • scipy
  • pynbody
  • matplotlib
  • changa_uw
    Currently, the UW version of ChaNGa is required. to properly implement sinks, the master branch of ChaNGa should be checked out.

2. Download diskpy

You can clone the repo using https://github.com/ibackus/diskpy.git

3. Setup diskpy

ChaNGa is required by diskpy. To allow diskpy to properly execute ChaNGa, you'll have to edit or create a preset for running ChaNGa. This can be done in python and is pretty simple. This only needs to be done once, the settings will be saved.

ChaNGa presets are store as a 4 element list (or tuple). These basically supply the command-line arguments which are used for executing ChaNGa and they are all strings [runner, runner_arguments, ChaNGa, ChaNGa_arguments]

  • runner e.g., 'charmrun' or 'mpirun', etc...
  • runner_arguments Additional arguments used by the runner. For no extra arguments, set to an empty string ''
  • ChaNGa Command for running ChaNGa, e.g. 'ChaNGa' or '~/bin/ChaNGa_uw'
  • ChaNGa_arguments Additional arguments supplied to ChaNGa. For no extra arguments, set to an empty string ''

Here's an example of setting up the 'local' preset.

from diskpy import global_settings

# Echo the default global settings if you want
global_settings()

# Edit the 'local' changa preset
global_settings['changa_presets']['local'] = \
['charmrun', '++local', 'ChaNGa', '-D 3']

# Change which preset is used by default
global_settings['changa_presets']['default'] = 'local'

# Save settings
global_settings.save()

If needed, the default settings can be restored:

global_settings.restore_defaults()
global_settings.save()

Clone this wiki locally