Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e241426
feat(readcon): replace con2matter FILE* parser with readcon-core
HaoZeke Feb 18, 2026
374f57f
feat(con): replace all FILE* con I/O with readcon-core v0.4.1
HaoZeke Feb 24, 2026
a0dd596
refactor(con): remove FILE* usage from all con I/O call sites
HaoZeke Feb 24, 2026
b68d707
refactor: replace FILE*/fprintf with fmt::output_file across all Job …
HaoZeke Feb 24, 2026
48c4855
ci(chore): fixup
HaoZeke Feb 24, 2026
4ee7b9a
chore(deps): update
HaoZeke Feb 24, 2026
c547a4e
style: apply clang-format to modified C++ files
HaoZeke Feb 24, 2026
5079fe8
feat(py): replace fileio con I/O with readcon package
HaoZeke Feb 24, 2026
07a2032
bld: replace PDM with uv for dependency management
HaoZeke Feb 24, 2026
27c4696
fix(ci): resolve pixi task redirect, benchmark main, docs uv
HaoZeke Feb 24, 2026
ae66dd5
docs: update confile design docs and install guide
HaoZeke Feb 24, 2026
47d3992
perf(deps): update readcon-core to v0.4.3
HaoZeke Feb 24, 2026
450bdfb
fix(ci): regenerate uv.lock without pytorch extra-index
HaoZeke Feb 24, 2026
184d21c
docs: update docbuild for uv, document extra-index pitfall
HaoZeke Feb 24, 2026
783bb12
fix(ci): install build deps before no-isolation pip install, update d…
HaoZeke Feb 24, 2026
a08ccc7
fix(ci): use PYTHONPATH instead of pip install for docs build
HaoZeke Feb 24, 2026
d046fcd
fix(deps): use commit hash in readcon-core.wrap for shallow clone
HaoZeke Feb 24, 2026
31f193a
fix(ci): pass --no-project to uv run in docs build
HaoZeke Feb 24, 2026
16bcc48
fix(ci): use shell: bash for cbindgen install across all workflows
HaoZeke Feb 24, 2026
f3b4beb
docs: add towncrier fragments for readcon migration and uv switch
HaoZeke Feb 24, 2026
8fbf4ef
fix(ci): docs use .venv/bin/sphinx-build, update readcon-core wrap
HaoZeke Feb 24, 2026
5531731
fix(ci): partial_dependency for readcon, pixi-native docs build
HaoZeke Feb 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
6 changes: 5 additions & 1 deletion .github/workflows/ci_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cp -r /tmp/_bench_preserve/benchmarks/ benchmarks/
cp /tmp/_bench_preserve/asv.conf.json asv.conf.json

- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: false
Expand All @@ -50,6 +50,10 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Build
run: |
pixi run bash -c "meson setup bbdir \
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_build_akmc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
os: [ubuntu-22.04, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
Expand All @@ -27,6 +27,10 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Use Homebrew gfortran (macOS)
if: runner.os == 'macOS'
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_build_gprd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
git clone git@github.com:TheochemUI/gpr_optim.git subprojects/gpr_optim
cd subprojects/gpr_optim
git checkout 26242c8e94569ef81103ece4662008c3250ada55
- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
Expand All @@ -37,6 +37,10 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Install eon
shell: pixi run bash -e {0}
run: |
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,15 @@ jobs:
with:
fetch-depth: 0

- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
activate-environment: true
environments: >-
docs

- name: Install uv
uses: astral-sh/setup-uv@v6

- name: Generate Docs
shell: pixi run bash -e {0}
run: |
uvx pdm sync
uvx pdm run pip install . -vvv
uvx pdm run sphinx-build -b html docs/source docs/build/html
run: pixi run -e docs makedocs

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_metatomic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
os: [ubuntu-22.04, macos-14]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
Expand All @@ -31,6 +31,10 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Use Homebrew gfortran (macOS)
if: runner.os == 'macOS'
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_serve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
Expand All @@ -30,6 +30,10 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Build with serve mode
shell: pixi run bash -e {0}
run: |
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/ci_xtb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
os: [ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.10
- uses: prefix-dev/setup-pixi@v0.9.4
with:
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
Expand All @@ -33,6 +33,10 @@ jobs:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install cbindgen
shell: bash
run: command -v cbindgen || cargo install cbindgen

- name: Install eon
shell: pixi run bash -e {0}
run: |
Expand Down
86 changes: 37 additions & 49 deletions client/BasinHoppingJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
** https://github.com/TheochemUI/eOn
*/

#include <math.h>
#include <stdio.h>
#include <cmath>
#include <filesystem>
#include <string>

#include "BasinHoppingJob.h"
Expand Down Expand Up @@ -82,9 +82,7 @@ std::vector<std::string> BasinHoppingJob::run(void) {
*minimumEnergyStructure = *current;
int nsteps = params.basin_hopping_options.steps +
params.basin_hopping_options.quenching_steps;
long totalfc;
FILE *pFile;
pFile = fopen("bh.dat", "w");
auto bhFile = fmt::output_file("bh.dat");

SPDLOG_LOGGER_DEBUG(
log, "[Basin Hopping] {:4s} {:12s} {:12s} {:12s} {:4s} {:5s} {:5s}",
Expand Down Expand Up @@ -190,9 +188,10 @@ std::vector<std::string> BasinHoppingJob::run(void) {

snprintf(fname, 128, "energy_%.5i.dat", step + 1);
returnFiles.push_back(fname);
FILE *fh = fopen(fname, "w");
fprintf(fh, "%.10e\n", currentEnergy);
fclose(fh);
{
auto efh = fmt::output_file(fname);
efh.print("{:.10e}\n", currentEnergy);
}
}
}

Expand All @@ -205,21 +204,15 @@ std::vector<std::string> BasinHoppingJob::run(void) {
minTrial->matter2con("movie", true);
}

// totalfc = Potential::fcallsTotal;
char acceptReject[2];
acceptReject[1] = '\0';
if (accepted) {
acceptReject[0] = 'A';
} else {
acceptReject[0] = 'R';
}
// SPDLOG_LOGGER_DEBUG(log, "[Basin Hopping] %5i %12.3f %12.3f %12.3f %4i
// %5.3f %5.3f %1s\n",
// step+1, currentEnergy, minTrial->getPotentialEnergy(),
// minimumEnergy, minfcalls, totalAccept/((double)step+1),
// curDisplacement, acceptReject);
// fprintf(pFile, "%6i %9ld %12.4e %12.4e\n",step+1,totalfc,currentEnergy,
// minTrial->getPotentialEnergy());
SPDLOG_LOGGER_DEBUG(log,
"[Basin Hopping] {:5d} {:12.3f} {:12.3f} {:12.3f} "
"{:5.3f} {:5.3f} {:1s}",
step + 1, currentEnergy, minTrial->getPotentialEnergy(),
minimumEnergy,
totalAccept / (static_cast<double>(step) + 1),
curDisplacement, accepted ? "A" : "R");
bhFile.print("{:6d} {:12.4e} {:12.4e}\n", step + 1, currentEnergy,
minTrial->getPotentialEnergy());

if (minimumEnergy < params.basin_hopping_options.stop_energy) {
break;
Expand Down Expand Up @@ -261,43 +254,38 @@ std::vector<std::string> BasinHoppingJob::run(void) {
recentAccept = 0;
}
}
fclose(pFile);

/* Save Results */

FILE *fileResults, *fileProduct;

std::string resultsFilename("results.dat");
returnFiles.push_back(resultsFilename);
fileResults = fopen(resultsFilename.c_str(), "wb");
{
auto out = fmt::output_file(resultsFilename);

if (params.debug_options.write_movies == true) {
std::string movieFilename("movie.xyz");
returnFiles.push_back(movieFilename);
}
if (params.debug_options.write_movies == true) {
std::string movieFilename("movie.xyz");
returnFiles.push_back(movieFilename);
}

fprintf(fileResults, "%d termination_reason\n", 0);
fprintf(fileResults, "%.6f minimum_energy\n", minimumEnergy);
fprintf(fileResults, "%ld random_seed\n", params.main_options.randomSeed);
fprintf(fileResults, "%.3f acceptance_ratio\n",
totalAccept / params.basin_hopping_options.steps);
if (params.basin_hopping_options.swap_probability > 0) {
fprintf(fileResults, "%.3f swap_acceptance_ratio\n",
swap_accept / double(swap_count));
out.print("{} termination_reason\n", 0);
out.print("{:.6f} minimum_energy\n", minimumEnergy);
out.print("{} random_seed\n", params.main_options.randomSeed);
out.print("{:.3f} acceptance_ratio\n",
totalAccept / params.basin_hopping_options.steps);
if (params.basin_hopping_options.swap_probability > 0) {
out.print("{:.3f} swap_acceptance_ratio\n",
swap_accept / double(swap_count));
}
out.print("{} total_normal_displacement_steps\n",
disp_count - jump_count -
params.basin_hopping_options.quenching_steps);
out.print("{} total_jump_steps\n", jump_count);
out.print("{} total_swap_steps\n", swap_count);
}
fprintf(fileResults, "%ld total_normal_displacement_steps\n",
disp_count - jump_count -
params.basin_hopping_options.quenching_steps);
fprintf(fileResults, "%d total_jump_steps\n", jump_count);
fprintf(fileResults, "%d total_swap_steps\n", swap_count);
// fprintf(fileResults, "%d total_force_calls\n", Potential::fcallsTotal);
fclose(fileResults);

std::string productFilename("min.con");
returnFiles.push_back(productFilename);
fileProduct = fopen(productFilename.c_str(), "wb");
minimumEnergyStructure->matter2con(fileProduct);
fclose(fileProduct);
minimumEnergyStructure->matter2con(productFilename);

std::string bhFilename("bh.dat");
returnFiles.push_back(bhFilename);
Expand Down
7 changes: 1 addition & 6 deletions client/DynamicsJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
** Repo:
** https://github.com/TheochemUI/eOn
*/
#include <stdio.h>
#include <string>

#include "Dynamics.h"
Expand All @@ -30,13 +29,9 @@ std::vector<std::string> DynamicsJob::run(void) {
d->run();

*F = *R;
FILE *fileProduct;
std::string productFilename("final.con");
returnFiles.push_back(productFilename);

fileProduct = fopen(productFilename.c_str(), "wb");
F->matter2con(fileProduct);
fclose(fileProduct);
F->matter2con(productFilename);

delete d;

Expand Down
17 changes: 7 additions & 10 deletions client/FiniteDifferenceJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,23 @@ std::vector<std::string> FiniteDifferenceJob::run(void) {
AtomMatrix displacement;
displacement.resize(reactant->numberOfAtoms(), 3);
displacement.setZero();
printf("displacing atoms:");
SPDLOG_DEBUG("displacing atoms:");
for (int i = 0; i < reactant->numberOfAtoms(); i++) {
if (reactant->distance(epicenter, i) <= 3.3) {
printf(" %i", i);
SPDLOG_DEBUG(" {}", i);
for (int j = 0; j < 3; j++) {
if (!reactant->getFixed(i)) {
displacement(i, j) = randomDouble(1.0);
}
}
}
}
printf("\n");
displacement.normalize();

// Loop over values of dimer dR and print the output to results.dat.
FILE *results = fopen("results.dat", "w");
fprintf(results, "%14s %14s\n", "dR", "curvature");
printf("%14s %14s\n", "dR", "curvature");
auto results = fmt::output_file("results.dat");
results.print("{:>14s} {:>14s}\n", "dR", "curvature");
SPDLOG_DEBUG("{:>14s} {:>14s}", "dR", "curvature");
AtomMatrix posB;
AtomMatrix forceB;
double curvature = 0.0;
Expand All @@ -63,11 +62,9 @@ std::vector<std::string> FiniteDifferenceJob::run(void) {
forceB = reactant->getForces();
curvature =
((forceB - forceA).array() * displacement.array()).sum() / dRs[dRi];
fprintf(results, "%14.8f %14.8f\n", dRs[dRi], curvature);
printf("%14.8f %14.8f\n", dRs[dRi], curvature);
fflush(results);
results.print("{:14.8f} {:14.8f}\n", dRs[dRi], curvature);
SPDLOG_DEBUG("{:14.8f} {:14.8f}", dRs[dRi], curvature);
}
fclose(results);

std::vector<std::string> empty;
return empty;
Expand Down
4 changes: 1 addition & 3 deletions client/GPSurrogateJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@ std::vector<std::string> GPSurrogateJob::run(void) {

std::string nebFilename(fmt::format("neb_final_gpr_{:03d}.con", n_gp));
returnFiles.push_back(nebFilename);
FILE *fileNEB = fopen(nebFilename.c_str(), "wb");
for (long i = 0; i <= neb->numImages + 1; i++) {
neb->path[i]->matter2con(fileNEB);
neb->path[i]->matter2con(nebFilename, /*append=*/i > 0);
}
fclose(fileNEB);
// } else
if (status_neb == NudgedElasticBand::NEBStatus::GOOD &&
helper_functions::surrogate::accuratePES(neb->path, pot)) {
Expand Down
10 changes: 6 additions & 4 deletions client/GlobalOptimizationJob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ std::vector<std::string> GlobalOptimizationJob::run(void) {
} else {
earrim1 = earr[i - 1];
}
fprintf(earrfile, "%5zu %15.5f %15.5f %15.5f ", i + 1, earr[i],
earr[i] - earr[0], earr[i] - earrim1);
earrfile.print("{:5d} {:15.5f} {:15.5f} {:15.5f} ", i + 1, earr[i],
earr[i] - earr[0], earr[i] - earrim1);
}
// globopt.run();
return returnFiles;
Expand Down Expand Up @@ -191,8 +191,10 @@ void GlobalOptimizationJob::report(Matter *matter_hop) {
double epot_hop = matter_hop->getPotentialEnergy();
double temp = (2.0 * ekin_p / params.constants.kB);
double dt = params.dynamics_options.time_step;
fprintf(monfile, "%15.5f %15.5f %11zu %12.2f %c%c %5ld %5ld",
epot_hop, ediff, (size_t)temp, dt, C1, C2, fcallsMove, fcallsRelax);
monfile.print(
"{:15.5f} {:15.5f} {:11d} {:12.2f} {:c}{:c} {:5d} {:5d}",
epot_hop, ediff, static_cast<size_t>(temp), dt, C1, C2, fcallsMove,
fcallsRelax);
}

void GlobalOptimizationJob::decisionStep(Matter *matter_cur,
Expand Down
Loading
Loading