Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
15fa170
define primitive regex
pranabdas Jun 8, 2026
c553e0f
do not trac tsc compiled .js scripts
pranabdas Jun 8, 2026
a82f5d9
combine different espresso versions together
pranabdas Jun 8, 2026
1e0f525
bump npm packages
pranabdas Jun 8, 2026
1d6b1bc
bump github ci actions
pranabdas Jun 8, 2026
55e563b
fix tests
pranabdas Jun 8, 2026
f266bd0
fix linter
pranabdas Jun 8, 2026
80d3562
fix js test
pranabdas Jun 8, 2026
0f182d6
add regex for namelist block extraction
pranabdas Jun 10, 2026
1e03f6a
build a separate regex dict
pranabdas Jun 11, 2026
5d6b06e
rename: NAMELIST_NAME -> BLOCK_NAME
pranabdas Jun 11, 2026
4738943
add possible namelist values
pranabdas Jun 11, 2026
df612b6
chore: revert espresso_namelist.yml file name
pranabdas Jun 11, 2026
43f0a6d
include key value pair regex
pranabdas Jun 12, 2026
b96352f
chore: comment
pranabdas Jun 12, 2026
8f27c31
add cell parameters regex
pranabdas Jun 13, 2026
59b46ce
interpolate primitives build time
pranabdas Jun 13, 2026
994cc93
interpolate params build time + update tests
pranabdas Jun 13, 2026
1f9deda
chore: move fixture file
pranabdas Jun 13, 2026
8c2f2f2
wrap regex parts in single quotes
pranabdas Jun 13, 2026
273d825
add regex for atomic positions card
pranabdas Jun 13, 2026
6c0ea75
use more strict regex for optional constraints
pranabdas Jun 13, 2026
afbe476
incorporate espresso regex dict to main pwin.yml
pranabdas Jun 13, 2026
1292b88
put schemas under pwin
pranabdas Jun 13, 2026
d000481
update README
pranabdas Jun 13, 2026
632ebfa
revert back to existing dir structure with multiple versions
pranabdas Jun 19, 2026
f0d4be8
chore: bump gh actions/checkout
pranabdas Jun 19, 2026
15b02d0
update README
pranabdas Jun 19, 2026
31a9365
inherit espresso v7.1 schema from v5.2.1
pranabdas Jun 19, 2026
904e804
furter nest regex dicts to distinguish stdin and stdout regex
pranabdas Jun 20, 2026
ede9e38
combine two float regex as same group
pranabdas Jun 23, 2026
b34f207
separate cell parameters row for reuse
pranabdas Jun 23, 2026
1e8b932
separate atomic positions row for reuse
pranabdas Jun 23, 2026
94a1423
individual capture groups for coordinates
pranabdas Jun 23, 2026
e757ea4
individual capture groups for cell parameters
pranabdas Jun 23, 2026
8fd59fb
chore: reorganize fixture file
pranabdas Jun 24, 2026
200745c
move kv pairs to separate partials.yml
pranabdas Jun 24, 2026
3c6374a
consider quoted values in kv pair
pranabdas Jun 24, 2026
83b1889
reuse kv pairs in fortran namelist
pranabdas Jun 24, 2026
274eb37
add missing namelists
pranabdas Jun 24, 2026
6dba20f
now that we have more strict namelist, remove namelist_block
pranabdas Jun 24, 2026
32780d2
add case insensitive flag for namelist
pranabdas Jun 24, 2026
c506183
move cell_parameters_row and atomic_positions_row to partials
pranabdas Jun 24, 2026
b3d1450
add system namelist to stdin
pranabdas Jun 24, 2026
b363cad
remove namelist nesting, add electrons namelist, fix tests
pranabdas Jun 24, 2026
21103aa
fix tests
pranabdas Jun 24, 2026
a43962d
chore
pranabdas Jun 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ concurrency:

jobs:
run-py-linter:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8.6]
python-version: [3.10.x]

steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -33,23 +33,22 @@ jobs:

run-py-tests:
needs: run-py-linter
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.8.x
- 3.9.x
- 3.10.x
- 3.11.x
- 3.12.x

steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -67,17 +66,17 @@ jobs:
strategy:
matrix:
node-version:
- 14.x
- 20.x
- 22.x

steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -86,7 +85,7 @@ jobs:
- name: Run JS validate
uses: ./actions/js/validate
with:
node-version: '14.x'
node-version: ${{ matrix.node-version }}
skip-eslint: 'true'

- name: Run JS tests
Expand All @@ -101,10 +100,10 @@ jobs:

steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

- name: Checkout actions repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -113,7 +112,7 @@ jobs:
- name: Publish JS release
uses: ./actions/js/publish
with:
node-version: 14.19.x
node-version: '22.x'
npm-token: ${{ secrets.NPM_TOKEN }}
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}

Expand All @@ -124,12 +123,12 @@ jobs:

steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
lfs: true

- name: Checkout actions repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
Expand All @@ -138,7 +137,7 @@ jobs:
- name: Publish python release
uses: ./actions/py/publish
with:
python-version: 3.8.x
python-version: 3.10.x
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
pypi-api-token: ${{ secrets.PYPI_API_TOKEN }}
publish-tag: 'false'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ cython_debug/
node_modules/
.eslintcache
.nyc_output/
src/js/build_schemas.js
src/js/functions.js

########### GENERAL #############
*.DS_Store
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Or using npm:

3. Use regex schemas:
```javascript
const calculationPattern = regexSchemas.espresso["5.8.1"].["pw.x"].calculation;
const calculationPattern = regexSchemas.espresso["5.2.1"]["pw.x"]["stdin"].calculation;
const regex = new RegExp(calculationPattern.regex, calculationPattern.flags.join("));
```

Expand Down Expand Up @@ -65,10 +65,10 @@ import pointer from "json-pointer";

const espressoNamelistRegex = pointer.get(
schemas,
"/applications/espresso/5.2.1/pw.x/control/_format/namelist",
"/applications/espresso/5.2.1/pw.x/stdin/control/_format",
);

// _format/namelist contains regex with template string
// _format contains regex with template string
// available templates for regex should be enumerated in params section
// name of param define template string to replace
// possible values will be enumerated as value of param
Expand All @@ -86,7 +86,7 @@ const controlBlock = controlBlocksMatch[0];

const regexObject = pointer.get(
schemas,
"/applications/espresso/5.2.1/pw.x/control/calculation",
"/applications/espresso/5.2.1/pw.x/stdin/control/calculation",
);
const regexCalculation = new RegExp(
regexObject.regex,
Expand Down
2 changes: 1 addition & 1 deletion data/schemas.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"applications":{"espresso":{"5.2.1":{"pw.x":{"_fingerprints":[{"regex":"^&control","flags":["g","i"],"isRequired":true},{"regex":"^&electrons","flags":["g","i"],"isRequired":true}],"control":{"_format":{"namelist":{"regex":"(\\$|&){{BLOCK_NAME}}\\n(?:\\s+[A-Za-z_]+\\s*=\\s*(?:['\"].*?['\"]|[^\\/\\n]+)(?:\\n\\s+[A-Za-z_]+\\s*=\\s*(?:['\"].*?['\"]|[^\\/\\n]+))*)?\\s*\\/","flags":["g","m"],"params":{"BLOCK_NAME":["CONTROL","ELECTRONS","IONS","CELL","SYSTEM"]}}},"calculation":{"regex":"calculation\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"title":{"regex":"title\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"restart_mode":{"regex":"restart_mode\\s*=\\s*'([^']+)'","flags":["g","m","i"]}}}},"7.1":{"pw.x":{"_fingerprints":[{"regex":"^&control","flags":["g","i"],"isRequired":true},{"regex":"^&electrons","flags":["g","i"],"isRequired":true}],"control":{"_format":{"namelist":{"regex":"(\\$|&){{BLOCK_NAME}}\\n(?:\\s+[A-Za-z_]+\\s*=\\s*(?:['\"].*?['\"]|[^\\/\\n]+)(?:\\n\\s+[A-Za-z_]+\\s*=\\s*(?:['\"].*?['\"]|[^\\/\\n]+))*)?\\s*\\/","flags":["g","m"],"params":{"BLOCK_NAME":["CONTROL","ELECTRONS","IONS","CELL","SYSTEM"]}}},"calculation":{"regex":"...","flags":["g","m","i"]}}}}}}}
{"applications":{"espresso":{"5.2.1":{"pw.x":{"stdin":{"_fingerprints":[{"regex":"^&control","flags":["g","i"],"isRequired":true},{"regex":"^&electrons","flags":["g","i"],"isRequired":true}],"control":{"_format":{"regex":"(\\$|&)(CONTROL)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["CONTROL"]}},"calculation":{"regex":"calculation\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"title":{"regex":"title\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"restart_mode":{"regex":"restart_mode\\s*=\\s*'([^']+)'","flags":["g","m","i"]}},"system":{"_format":{"regex":"(\\$|&)(SYSTEM)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["SYSTEM"]}}},"electrons":{"_format":{"regex":"(\\$|&)(ELECTRONS)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["ELECTRONS"]}}},"cell_parameters_card":{"regex":"CELL_PARAMETERS\\s*[{(]?\\s*(alat|bohr|angstrom)?\\s*[)}]?\\s*\\n((?:[ \\t]*(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]*\\n?){3})","flags":["i"],"params":{"UNIT":["alat","bohr","angstrom"]}},"atomic_positions_card":{"regex":"ATOMIC_POSITIONS\\s*[{(]?\\s*(alat|bohr|angstrom|crystal|crystal_sg)?\\s*[)}]?\\s*\\n((?:[ \\t]*(?P<symbol>\\w+)[ \\t]+(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)(?:(?:[ \\t]+[01]){3})?[ \\t]*\\n?)+)","flags":["i"],"params":{"UNIT":["alat","bohr","angstrom","crystal","crystal_sg"]}}}}},"7.1":{"pw.x":{"stdin":{"_fingerprints":[{"regex":"^&control","flags":["g","i"],"isRequired":true},{"regex":"^&electrons","flags":["g","i"],"isRequired":true}],"control":{"_format":{"regex":"(\\$|&)(CONTROL)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["CONTROL"]}},"calculation":{"regex":"calculation\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"title":{"regex":"title\\s*=\\s*'([^']+)'","flags":["g","m","i"]},"restart_mode":{"regex":"restart_mode\\s*=\\s*'([^']+)'","flags":["g","m","i"]}},"system":{"_format":{"regex":"(\\$|&)(SYSTEM)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["SYSTEM"]}}},"electrons":{"_format":{"regex":"(\\$|&)(ELECTRONS)\\s*\\n(?:(?:\\s*(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))|\\s*(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+)))\\s*,?\\s*)*\\s*\\/","flags":["g","i","m"],"params":{"BLOCK_NAME":["ELECTRONS"]}}},"cell_parameters_card":{"regex":"CELL_PARAMETERS\\s*[{(]?\\s*(alat|bohr|angstrom)?\\s*[)}]?\\s*\\n((?:[ \\t]*(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]*\\n?){3})","flags":["i"],"params":{"UNIT":["alat","bohr","angstrom"]}},"atomic_positions_card":{"regex":"ATOMIC_POSITIONS\\s*[{(]?\\s*(alat|bohr|angstrom|crystal|crystal_sg)?\\s*[)}]?\\s*\\n((?:[ \\t]*(?P<symbol>\\w+)[ \\t]+(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)(?:(?:[ \\t]+[01]){3})?[ \\t]*\\n?)+)","flags":["i"],"params":{"UNIT":["alat","bohr","angstrom","crystal","crystal_sg"]}}}}},"partials":{"kv_pair":{"regex":"(\\w+)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/=]+))","flags":["g","i","m"]},"kv_pair_with_index":{"regex":"(\\w+)\\s*\\(\\s*(\\d+)\\s*\\)\\s*=\\s*((?:['\"].*?['\"]|[^,\\n/]+))","flags":["g","i","m"]},"cell_parameters_row":{"regex":"[ \\t]*(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]*\\n?"},"atomic_positions_row":{"regex":"[ \\t]*(?P<symbol>\\w+)[ \\t]+(?P<x>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<y>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)[ \\t]+(?P<z>[-+]?(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eEdD][-+]?\\d+)?)(?:(?:[ \\t]+[01]){3})?[ \\t]*\\n?"}}}}}
Loading
Loading