Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
18d785a
SOF-7915: export physical constants via python interface
pranabdas Jun 3, 2026
ae72089
build js constants from the same yaml source of truth
pranabdas Jun 3, 2026
4da44a1
add build rule to pre-commit
pranabdas Jun 3, 2026
3a0c91b
chore: pin actions to commit hash
pranabdas Jun 3, 2026
0582b10
add comment removal for fortran lang
pranabdas Jun 3, 2026
1574df2
add tests for remove_comments_from_source_code
pranabdas Jun 4, 2026
6750302
remove inline comments for shell
pranabdas Jun 8, 2026
3a80497
add test for removal of comments from bash script
pranabdas Jun 8, 2026
84c7926
remove inline comments from bash js interface
pranabdas Jun 9, 2026
ba15d30
add js tests for comment removal
pranabdas Jun 9, 2026
0bf4e4a
fix py test
pranabdas Jun 9, 2026
52a8f38
separate regex dict for espresso and fortran for comment removal
pranabdas Jun 10, 2026
cb8af81
add separate test for fortran comment removal
pranabdas Jun 10, 2026
78ac542
todo comment
pranabdas Jun 10, 2026
3644c60
add a regex search util
pranabdas Jun 12, 2026
bc479fd
merge main and resolve conflicts
pranabdas Jun 12, 2026
c88d62c
add a regex search by schema
pranabdas Jun 12, 2026
01b7a69
remove param_replacements as it is moved to regex lib
pranabdas Jun 13, 2026
4ad29b7
remove espress as language for comment removal
pranabdas Jun 19, 2026
5675929
chore: bump gh actions
pranabdas Jun 19, 2026
ab9f497
bump minor deps
pranabdas Jun 20, 2026
a1f80d2
add tests for regex utils
pranabdas Jul 2, 2026
4d2817d
bump @exabyte/eslint-config
pranabdas Jul 3, 2026
ce51213
use latest version of ruff for python linting
pranabdas Jul 3, 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
31 changes: 16 additions & 15 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,22 @@ jobs:

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

- name: Checkout actions repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
repository: mat3ra/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

- name: Run ruff linter
uses: ./actions/py/lint
with:
python-version: ${{ matrix.python-version }}
ruff-version: 0.15.20

run-py-tests:
needs: run-py-linter
Expand All @@ -43,14 +44,14 @@ jobs:

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

- name: Checkout actions repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
repository: mat3ra/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

Expand All @@ -70,14 +71,14 @@ jobs:

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

- name: Checkout actions repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
repository: mat3ra/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

Expand All @@ -102,12 +103,12 @@ jobs:

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

- name: Checkout actions repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
repository: mat3ra/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

Expand All @@ -128,14 +129,14 @@ jobs:

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

- name: Checkout actions repository
uses: actions/checkout@v4
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
repository: Exabyte-io/actions
repository: mat3ra/actions
token: ${{ secrets.BOT_GITHUB_TOKEN }}
path: actions

Expand Down
20 changes: 11 additions & 9 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

#### Below is an example of how to rebuild JS and PY assets if JSON assets have changed.
# SRC_PATTERN="\.json$"
# if git diff --cached --name-only | grep --quiet -E "$SRC_PATTERN"
# then
# echo "JSON assets changed. Running build scripts."
# echo "Re-building JS and PY assets using JS script."
# npm run build:js-and-python-modules
# fi
SRC_PATTERN="constants\.json$"
if git diff --cached --name-only | grep --quiet -E "$SRC_PATTERN"
then
echo "JSON assets changed. Running build scripts."
# Run your custom script to generate constants.py and constants.js
npm run build:constants

# Stage the newly generated files
git add src/py/mat3ra/utils/constants.py
git add src/js/shared/constants.js
fi

# Automatically lint staged files in pre-commit hook
npm run transpile
npx lint-staged
git add dist/js
819 changes: 420 additions & 399 deletions dist/js/index.d.ts

Large diffs are not rendered by default.

546 changes: 280 additions & 266 deletions dist/js/index_browser.d.ts

Large diffs are not rendered by default.

546 changes: 280 additions & 266 deletions dist/js/index_server.d.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/js/shared/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ declare namespace _default {
export { tolerance };
export { units };
export { ATOMIC_COORD_UNITS };
export { HASH_TOLERANCE };
}
export default _default;
36 changes: 17 additions & 19 deletions dist/js/shared/constants.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,35 @@
"use strict";
// This file is autogenerated from src/shared/constants.yaml
// DO NOT EDIT DIRECTLY! Edit above YAML file and run 'npm run build:constants'.
Object.defineProperty(exports, "__esModule", { value: true });
exports.HASH_TOLERANCE = exports.ATOMIC_COORD_UNITS = exports.units = exports.tolerance = exports.coefficients = void 0;
exports.coefficients = {
EV_TO_RY: 0.0734986176,
BOHR_TO_ANGSTROM: 0.52917721092,
ANGSTROM_TO_BOHR: 1 / 0.52917721092,
EV_A_TO_RY_BOHR: 1 / 25.71104309541616,
"EV_TO_RY": 0.0734986444,
"BOHR_TO_ANGSTROM": 0.529177210544,
"ANGSTROM_TO_BOHR": 1.8897261259077822,
"EV_A_TO_RY_BOHR": 0.0388938075966032
};
exports.tolerance = {
// in crystal coordinates
length: 0.01,
lengthAngstrom: 0.001,
pointsDistance: 0.001,
"length": 0.01,
"lengthAngstrom": 0.001,
"pointsDistance": 0.001
};
exports.units = {
bohr: "bohr",
angstrom: "angstrom",
degree: "degree",
radian: "radian",
alat: "alat",
"bohr": "bohr",
"angstrom": "angstrom",
"degree": "degree",
"radian": "radian",
"alat": "alat"
};
/**
* @summary Coordinates units for a material's basis.
*/
exports.ATOMIC_COORD_UNITS = {
crystal: "crystal",
cartesian: "cartesian",
"crystal": "crystal",
"cartesian": "cartesian"
};
// Only 3 digits will be considered for lattice and basis params for hashing
exports.HASH_TOLERANCE = 3;
exports.default = {
coefficients: exports.coefficients,
tolerance: exports.tolerance,
units: exports.units,
ATOMIC_COORD_UNITS: exports.ATOMIC_COORD_UNITS,
HASH_TOLERANCE: exports.HASH_TOLERANCE,
};
Loading