Read and Load Functions

A guide to using the read and load functions included with axtools.

On this page, you'll learn:

  • How to read from any .ax file

  • The differences between .ax files and .tmpl.ax files

  • How to use the output from read in load

read

The read function takes the path to a .ax as its only parameter. It will return an AxiniteArgs object.

import axinite.tools as axtools

args = axtools.read("name.ax")

Template Files (.tmpl.ax) vs Simulation FIles (.ax) vs Meta Files (.meta.ax)

All Axinite file types files end with .ax, but template files have a .tmpl marker on their name.

Template files are sets of initial values that will later be transformed into .ax files through the load function.

load

The load method takes an AxiniteArgs object and a path to dump the simulation to. If the path is None or "" dumping will be skipped.

import axinite.tools as axtools

args = axtools.read("example.tmpl.ax")
bodies = axtools.load(args, "example.ax")

You can make the loading verbose with verbose=true.

Be sure to set your backend with args.backend = ax.xxx.

Last updated