Skip to content

Commit

Permalink
Fixes for signac 2 (#197)
Browse files Browse the repository at this point in the history
* Update jinja2 link

* Fixes for signac 2

* Fix: use lowercase booleans in JSON queries

Otherwise `signac find` yields errors like
Failed to parse query argument. Ensure that $QUERY is valid JSON!

* Remove lowercased changes that apply to Python
  • Loading branch information
cbkerr committed Jan 26, 2024
1 parent 49341d3 commit afc0763
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/flow-project.rst
Expand Up @@ -62,7 +62,7 @@ Let's initialize a signac :term:`project` with a few :term:`jobs<job>`, by execu
import signac
project = signac.init_project("MyProject")
project = signac.init_project()
for i in range(10):
project.open_job({"a": i}).init()
Expand Down
4 changes: 2 additions & 2 deletions docs/source/query.rst
Expand Up @@ -247,11 +247,11 @@ Simplified Syntax on the Command Line
It is possible to use search expressions directly on the command line, for example in combination with the ``$ signac find`` command.
In this case filter arguments are expected to be provided as valid JSON expressions.
For simple filters, you can use a simplified syntax instead of writing JSON.
For example, instead of ``{'p': 2}``, you can simply type ``p 2``.
For example, instead of ``{'p': 2}``, you can type ``p 2``.

A simplified expression consists of key-value pairs in alternation.
The first argument will then be interpreted as the first key, the second argument as the first value, the third argument as the second key, and so on.
If you provide an odd number of arguments, the last value will default to ``{'$exists': True}``.
If you provide an odd number of arguments, the last value will default to ``{'$exists': true}``.
Querying via operator is supported using the ``.``-operator.
Finally, you can use ``/<regex>/`` instead of ``{'$regex': '<regex>'}`` for regular expressions.

Expand Down
4 changes: 2 additions & 2 deletions docs/source/recipes.rst
Expand Up @@ -82,7 +82,7 @@ We often require multiple jobs with the same state point to collect enough infor
# init.py
import signac
project = signac.init_project("ideal-gas-project")
project = signac.init_project()
num_reps = 3
jobs = project.find_jobs({"replica_index.$exists": False})
Expand All @@ -105,7 +105,7 @@ Some **signac** :term:`project schemas<project schema>` are structured like a "g
import itertools
import signac
project = signac.init_project("ideal-gas-project")
project = signac.init_project()
def grid(gridspec):
Expand Down
4 changes: 2 additions & 2 deletions docs/source/templates.rst
Expand Up @@ -8,7 +8,7 @@ The **signac-flow** package uses jinja2_ templates to generate scripts for execu
Templates for simple bash execution and submission to popular schedulers and compute clusters are shipped with the package.
To customize the script generation, a user can replace the default template or customize any of the provided ones.

.. _jinja2: http://jinja.pocoo.org/
.. _jinja2: https://jinja.palletsprojects.com

Replacing the default template
==============================
Expand All @@ -26,7 +26,7 @@ This is an example for a basic template that would be sufficient for the simple

.. code-block:: jinja
cd {{ project.config.project_dir }}
cd {{ project.path }}
{% for operation in operations %}
{{ operation.cmd }}
Expand Down

0 comments on commit afc0763

Please sign in to comment.