The signac framework offers both a Python and a command-line interface.
The following code snippets show some examples on how to interact with a signac project.
Setup a project
We initialize a project in the local directory with:
This provides us access to the project interface.
After initialization, we can also access the project with
project = signac.get_project().
In the context of a signac project, all data is uniquely addressable by a specific state point (a set of key-value pairs, e.g., a dict).
Let’s calculate the volume of an ideal gas at different pressures p, but constant temperature kT and system size N. We will use signac to keep track of metadata (the state point) and data (the volume):
We can then iterate over the data space to access both metadata and data:
We can select a specific data subspace, using a filter argument:
This would give us the pressure and volume only where the temperature T is equal to 1.0.
Alternatively, we can select all jobs with a specific volume, using a document filter:
Of course, both filters may be used in combination.
Command line interface
The command line interface is designed to support workflows that are not Python-driven:
Setup a project
Initialize the project in the current root directory:
Write data to a file located in the job’s workspace:
Select data subspaces directly on the command line:
A reference of the full command line interface can be accessed via:
If you are interested in learning more, we recommend to go through the resources listed on the Support page!