From 6ca77ee94ea35b2ae8513978db44aa3a02fb95e9 Mon Sep 17 00:00:00 2001 From: Jas Kalayan Date: Wed, 23 Sep 2026 20:30:27 +0100 Subject: [PATCH 1/2] add copy of engine mappings into package --- .../generated/schema_enginemappings.json | 1700 +++++++++++++++++ biosim_schema/utils/generate_artifacts.py | 12 + biosim_schema/utils/paths.py | 11 + 3 files changed, 1723 insertions(+) create mode 100644 biosim_schema/schema/generated/schema_enginemappings.json create mode 100644 biosim_schema/utils/paths.py diff --git a/biosim_schema/schema/generated/schema_enginemappings.json b/biosim_schema/schema/generated/schema_enginemappings.json new file mode 100644 index 0000000..1dcc476 --- /dev/null +++ b/biosim_schema/schema/generated/schema_enginemappings.json @@ -0,0 +1,1700 @@ +{ + "forward": { + "gromacs": { + "SimulationMetadata.stages.minimisation.energy_tolerance": [ + { + "key": "emtol", + "value": null, + "unit": "kJ/mol/nm" + } + ], + "SimulationMetadata.stages.minimisation.number_of_minimisation_steps": [ + { + "key": "nsteps", + "value": null + } + ], + "SimulationMetadata.stages.minimisation.minimisation_distance_step_size": [ + { + "key": "emstep", + "value": null, + "unit": "nm" + } + ], + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "Steepest Descent": [ + { + "key": "integrator", + "value": "steep" + } + ], + "Conjugate Gradient": [ + { + "key": "integrator", + "value": "cg" + } + ], + "L-BFGS": [ + { + "key": "integrator", + "value": "l-bfgs" + } + ] + }, + "SimulationMetadata.settings.ensemble.ensemble_type": { + "NPT": [ + { + "key": "pcoupl", + "value": [ + "Berendsen", + "Parrinello-Rahman" + ] + } + ], + "NVT": [ + { + "key": "pcoupl", + "value": false + } + ], + "μVT": [ + { + "key": "pcoupl", + "value": false + }, + { + "key": "tcoupl", + "value": false + } + ] + }, + "SimulationMetadata.settings.ensemble.random_seed": [ + { + "key": "ld-seed", + "value": null + } + ], + "SimulationMetadata.settings.integrator.integrator_algorithm": { + "Velocity-Verlet": [ + { + "key": "integrator", + "value": [ + "md-vv", + "md-vv-avek" + ] + } + ], + "Leap-frog": [ + { + "key": "integrator", + "value": [ + "md", + "sd" + ] + } + ], + "Euler": [ + { + "key": "integrator", + "value": "bd" + } + ] + }, + "SimulationMetadata.settings.integrator.time_step": [ + { + "key": "dt", + "value": null, + "unit": "ps" + } + ], + "SimulationMetadata.settings.integrator.number_of_steps": [ + { + "key": "nsteps", + "value": null + } + ], + "SimulationMetadata.settings.barostat.barostat_algorithm": { + "Berendsen": [ + { + "key": "pcoupl", + "value": [ + "Berendsen", + "C-rescale" + ] + }, + { + "key": "barostat", + "value": 1 + } + ], + "Parrinello-Rahman": [ + { + "key": "pcoupl", + "value": "Parrinello-Rahman" + } + ], + "Monte Carlo": [ + { + "key": "barostat", + "value": 2 + } + ], + "Martyna-Tuckerman-Tobias-Klein": [ + { + "key": "pcoupl", + "value": "MTTK" + } + ] + }, + "SimulationMetadata.settings.barostat.compressibility_vector": [ + { + "key": "compressibility", + "value": null, + "unit": "1/bar" + } + ], + "SimulationMetadata.settings.barostat.target_pressure_vector": [ + { + "key": "ref-p", + "value": null, + "unit": "bar" + } + ], + "SimulationMetadata.settings.barostat.pressure_time_constant": [ + { + "key": "tau-p", + "value": null, + "unit": "ps" + } + ], + "SimulationMetadata.settings.barostat.pressure_coupling_frequency": [ + { + "key": "nstpcouple", + "value": null, + "unit": "1/ps" + } + ], + "SimulationMetadata.settings.barostat.pressure_coupling_type": { + "isotropic": [ + { + "key": "pcoupltype", + "value": "isotropic" + } + ], + "semi-isotropic": [ + { + "key": "pcoupltype", + "value": "semiisotropic" + } + ], + "anisotropic": [ + { + "key": "pcoupltype", + "value": "anisotropic" + } + ], + "surface tension": [ + { + "key": "pcoupltype", + "value": "surface-tension" + } + ] + }, + "SimulationMetadata.settings.thermostat.thermostat_algorithm": { + "Berendsen": [ + { + "key": "tcoupl", + "value": [ + "berendsen", + "v-rescale" + ] + } + ], + "Andersen": [ + { + "key": "tcoupl", + "value": [ + "andersen", + "andersen-massive" + ] + } + ], + "Nose-Hoover": [ + { + "key": "tcoupl", + "value": "nose-hoover" + } + ] + }, + "SimulationMetadata.settings.thermostat.target_temperature_vector": [ + { + "key": "ref-t", + "value": null, + "unit": "K" + } + ], + "SimulationMetadata.settings.thermostat.temperature_time_constant": [ + { + "key": "tau-t", + "value": null, + "unit": "ps" + } + ], + "SimulationMetadata.settings.thermostat.chain_length": [ + { + "key": "nh-chain-length", + "value": null + } + ], + "SimulationMetadata.settings.thermostat.friction_coefficient": [ + { + "key": "bd-fric", + "value": null, + "unit": "a/ps" + } + ], + "SimulationMetadata.settings.interactions.electrostatic_cutoff_distance": [ + { + "key": "rcoulomb", + "value": null, + "unit": "nm" + } + ], + "SimulationMetadata.settings.interactions.vdw_cutoff_distance": [ + { + "key": "rvdw", + "value": null, + "unit": "nm" + } + ], + "SimulationMetadata.settings.interactions.bond_length_constraints_algorithm": { + "SHAKE": [ + { + "key": "constraint-algorithm", + "value": "SHAKE" + } + ], + "LINCS": [ + { + "key": "constraint-algorithm", + "value": "LINCS" + } + ] + }, + "SimulationMetadata.settings.interactions.long_range_interaction_method": { + "Cutoff": [ + { + "key": "coulombtype", + "value": "Cut-off" + }, + { + "key": "vdwtype", + "value": "Cut-off" + } + ], + "Ewald": [ + { + "key": "coulombtype", + "value": "Ewald" + } + ], + "PME": [ + { + "key": "coulombtype", + "value": "PME" + }, + { + "key": "vdwtype", + "value": "PME" + } + ], + "P3M": [ + { + "key": "coulombtype", + "value": "P3M-AD" + } + ], + "RF": [ + { + "key": "coulombtype", + "value": "Reaction-Field" + } + ] + }, + "SimulationMetadata.observables.simulation_averages.average_kinetic_energy": [ + { + "key": "Kinetic En.", + "value": null, + "unit": "kJ/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_potential_energy": [ + { + "key": "Potential", + "value": null, + "unit": "kJ/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_enthalpy": [ + { + "key": "Total Energy", + "value": null, + "unit": "kJ/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_pressure": [ + { + "key": "Pressure (bar)", + "value": null, + "unit": "bar" + } + ], + "SimulationMetadata.observables.simulation_averages.average_temperature": [ + { + "key": "Temperature", + "value": null, + "unit": "K" + } + ], + "SimulationMetadata.observables.simulation_averages.average_volume_vector": [ + { + "key": "Box-X", + "value": null, + "unit": "nm" + }, + { + "key": "Box-Y", + "value": null, + "unit": "nm" + }, + { + "key": "Box-Z", + "value": null, + "unit": "nm" + } + ], + "SimulationMetadata.trajectory.simulation_box.periodic_boundary_conditions": { + "None": [ + { + "key": "pbc", + "value": false + } + ], + "xyz": [ + { + "key": "pbc", + "value": "xyz" + } + ], + "xy": [ + { + "key": "pbc", + "value": "xy" + } + ] + } + }, + "amber": { + "SimulationMetadata.stages.minimisation.energy_tolerance": [ + { + "key": "drms", + "value": null, + "unit": "10−4 kcal/mol/Å" + } + ], + "SimulationMetadata.stages.minimisation.number_of_minimisation_steps": [ + { + "key": "maxcyc", + "value": null + } + ], + "SimulationMetadata.stages.minimisation.minimisation_distance_step_size": [ + { + "key": "dx0", + "value": null, + "unit": "Å" + } + ], + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "Steepest Descent": [ + { + "key": "ntmin", + "value": [ + 1, + 2 + ] + } + ], + "Conjugate Gradient": [ + { + "key": "ntmin", + "value": [ + 0, + 1 + ] + } + ], + "XMIN": [ + { + "key": "ntmin", + "value": 3 + } + ], + "LMOD": [ + { + "key": "ntmin", + "value": 4 + } + ], + "None": [ + { + "key": "imin", + "value": 0 + } + ] + }, + "SimulationMetadata.settings.ensemble.ensemble_type": { + "NPT": [ + { + "key": "ntb", + "value": 2 + } + ], + "NVT": [ + { + "key": "ntb", + "value": 1 + } + ], + "μVT": [ + { + "key": "ntb", + "value": 0 + }, + { + "key": "ntt", + "value": 0 + }, + { + "key": "ntp", + "value": 0 + } + ] + }, + "SimulationMetadata.settings.ensemble.random_seed": [ + { + "key": "ig", + "value": null + } + ], + "SimulationMetadata.settings.integrator.time_step": [ + { + "key": "dt", + "value": null, + "unit": "ps" + } + ], + "SimulationMetadata.settings.integrator.number_of_steps": [ + { + "key": "nstlim", + "value": null + } + ], + "SimulationMetadata.settings.barostat.compressibility": [ + { + "key": "comp", + "value": null, + "unit": "1e10-6 1/bar" + } + ], + "SimulationMetadata.settings.barostat.target_pressure": [ + { + "key": "pres0", + "value": null, + "unit": "bar" + } + ], + "SimulationMetadata.settings.barostat.pressure_time_constant": [ + { + "key": "taup", + "value": null, + "unit": "ps" + } + ], + "SimulationMetadata.settings.barostat.pressure_coupling_type": { + "isotropic": [ + { + "key": "ntp", + "value": 1 + } + ], + "semi-isotropic": [ + { + "key": "ntp", + "value": 3 + } + ], + "anisotropic": [ + { + "key": "ntp", + "value": 2 + } + ] + }, + "SimulationMetadata.settings.thermostat.thermostat_algorithm": { + "Langevin": [ + { + "key": "ntt", + "value": 3 + } + ], + "Berendsen": [ + { + "key": "ntt", + "value": 1 + } + ], + "Andersen": [ + { + "key": "ntt", + "value": 2 + } + ], + "Nose-Hoover": [ + { + "key": "ntt", + "value": [ + 9, + 10 + ] + } + ], + "Bussi": [ + { + "key": "ntt", + "value": 11 + } + ] + }, + "SimulationMetadata.settings.thermostat.target_temperature": [ + { + "key": "temp0", + "value": null, + "unit": "K" + } + ], + "SimulationMetadata.settings.thermostat.collision_frequency": [ + { + "key": "gamma_ln", + "value": null, + "unit": "1/ps" + } + ], + "SimulationMetadata.settings.thermostat.chain_length": [ + { + "key": "nhc_chain_length", + "value": null + } + ], + "SimulationMetadata.settings.interactions.electrostatic_cutoff_distance": [ + { + "key": "cut", + "value": null, + "unit": "Å" + } + ], + "SimulationMetadata.settings.interactions.bond_length_constraints_algorithm": { + "SHAKE": [ + { + "key": "ntc", + "value": [ + 2, + 3 + ] + } + ] + }, + "SimulationMetadata.settings.interactions.long_range_interaction_method": { + "Ewald": [ + { + "key": "ew_type", + "value": 1 + } + ], + "PME": [ + { + "key": "ew_type", + "value": 0 + } + ] + }, + "SimulationMetadata.observables.simulation_averages.average_kinetic_energy": [ + { + "key": "EKtot", + "value": null, + "unit": "kcal/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_potential_energy": [ + { + "key": "EPtot", + "value": null, + "unit": "kcal/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_enthalpy": [ + { + "key": "Etot", + "value": null, + "unit": "kcal/mol" + } + ], + "SimulationMetadata.observables.simulation_averages.average_pressure": [ + { + "key": "PRESS", + "value": null, + "unit": "bar" + } + ], + "SimulationMetadata.observables.simulation_averages.average_temperature": [ + { + "key": "TEMP(K)", + "value": null, + "unit": "K" + } + ], + "SimulationMetadata.observables.simulation_averages.average_volume": [ + { + "key": "VOLUME", + "value": null, + "unit": "A^3" + } + ] + }, + "lammps": { + "SimulationMetadata.settings.integrator.time_step": [ + { + "key": "timestep", + "value": null, + "unit": "fs" + } + ], + "SimulationMetadata.settings.thermostat.target_temperature": [ + { + "key": "temp", + "value": null, + "unit": "K" + } + ] + }, + "toptrajparser": { + "SimulationMetadata.topology.connectivity.bonds": [ + { + "key": "bonds", + "value": null + } + ], + "SimulationMetadata.topology.connectivity.dihedrals": [ + { + "key": "dihedrals", + "value": null + } + ], + "SimulationMetadata.topology.particles.masses": [ + { + "key": "masses", + "value": null + } + ], + "SimulationMetadata.topology.particles.fixed_charges": [ + { + "key": "fixed_charges", + "value": null + } + ], + "SimulationMetadata.topology.particles.system_charge": [ + { + "key": "system_charge", + "value": null, + "unit": "e" + } + ], + "SimulationMetadata.topology.particles.coarse_grained": [ + { + "key": "coarse_grained", + "value": null + } + ], + "SimulationMetadata.trajectory.simulation_box.box_dimensions": [ + { + "key": "box_dimensions", + "value": null, + "unit": "Ang" + } + ], + "SimulationMetadata.trajectory.simulation_box.box_angles": [ + { + "key": "box_angles", + "value": null, + "unit": "degree" + } + ], + "SimulationMetadata.trajectory.simulation_box.box_type": { + "Cubic": [ + { + "key": "box_type", + "value": "cubic" + } + ], + "Tetragonal": [ + { + "key": "box_type", + "value": "tetragonal" + } + ], + "Orthorhombic": [ + { + "key": "box_type", + "value": "orthorhombic" + } + ], + "Truncated Octahedron": [ + { + "key": "box_type", + "value": "truncated octahedron" + } + ], + "Triclinic": [ + { + "key": "box_type", + "value": "triclinic" + } + ] + }, + "SimulationMetadata.trajectory.trajectory_output.positions": [ + { + "key": "positions", + "value": null + } + ], + "SimulationMetadata.trajectory.trajectory_output.forces": [ + { + "key": "forces", + "value": null + } + ], + "SimulationMetadata.trajectory.trajectory_output.velocities": [ + { + "key": "velocities", + "value": null + } + ], + "SimulationMetadata.trajectory.trajectory_output.water": [ + { + "key": "water", + "value": null + } + ], + "SimulationMetadata.trajectory.trajectory_output.frame_count": [ + { + "key": "frame_count", + "value": null + } + ], + "SimulationMetadata.composition.system_counts.total_molecule_count": [ + { + "key": "total_molecule_count", + "value": null + } + ], + "SimulationMetadata.composition.system_counts.total_atom_count": [ + { + "key": "total_atom_count", + "value": null + } + ], + "SimulationMetadata.composition.system_counts.unique_molecule_count": [ + { + "key": "unique_molecule_count", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.SMILES": [ + { + "key": "SMILES", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.InChI": [ + { + "key": "InChI", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.InChIKey": [ + { + "key": "InChIKey", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.protein_sequence": [ + { + "key": "protein_sequence", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.nucleic_sequence": [ + { + "key": "nucleic_sequence", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.molecular_formula": [ + { + "key": "molecular_formula", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.molecular_weight": [ + { + "key": "molecular_weight", + "value": null, + "unit": "g/mol" + } + ], + "SimulationMetadata.composition.molecule_ID.molecule_charge": [ + { + "key": "molecule_charge", + "value": null, + "unit": "e" + } + ], + "SimulationMetadata.composition.molecule_ID.molecule_count": [ + { + "key": "molecule_count", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.atom_count": [ + { + "key": "atom_count", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.monomer_count": [ + { + "key": "monomer_count", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.simulated_particle_names": [ + { + "key": "simulated_particle_names", + "value": null + } + ], + "SimulationMetadata.composition.molecule_ID.simulated_molecule_name": [ + { + "key": "simulated_molecule_name", + "value": null + } + ] + } + }, + "reverse": { + "gromacs": { + "emtol": { + "by_path": { + "SimulationMetadata.stages.minimisation.energy_tolerance": {} + }, + "path_metadata": {} + }, + "nsteps": { + "by_path": { + "SimulationMetadata.stages.minimisation.number_of_minimisation_steps": {}, + "SimulationMetadata.settings.integrator.number_of_steps": {} + }, + "path_metadata": {} + }, + "emstep": { + "by_path": { + "SimulationMetadata.stages.minimisation.minimisation_distance_step_size": {} + }, + "path_metadata": {} + }, + "integrator": { + "by_path": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "steep": [ + "Steepest Descent" + ], + "cg": [ + "Conjugate Gradient" + ], + "l-bfgs": [ + "L-BFGS" + ] + }, + "SimulationMetadata.settings.integrator.integrator_algorithm": { + "md-vv": [ + "Velocity-Verlet" + ], + "md-vv-avek": [ + "Velocity-Verlet" + ], + "md": [ + "Leap-frog" + ], + "sd": [ + "Leap-frog" + ], + "bd": [ + "Euler" + ] + } + }, + "path_metadata": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "multivalued": true + } + } + }, + "pcoupl": { + "by_path": { + "SimulationMetadata.settings.ensemble.ensemble_type": { + "Berendsen": [ + "NPT" + ], + "Parrinello-Rahman": [ + "NPT" + ], + "False": [ + "NVT", + "μVT" + ] + }, + "SimulationMetadata.settings.barostat.barostat_algorithm": { + "Berendsen": [ + "Berendsen" + ], + "C-rescale": [ + "Berendsen" + ], + "Parrinello-Rahman": [ + "Parrinello-Rahman" + ], + "MTTK": [ + "Martyna-Tuckerman-Tobias-Klein" + ] + } + }, + "path_metadata": {} + }, + "tcoupl": { + "by_path": { + "SimulationMetadata.settings.ensemble.ensemble_type": { + "False": [ + "μVT" + ] + }, + "SimulationMetadata.settings.thermostat.thermostat_algorithm": { + "berendsen": [ + "Berendsen" + ], + "v-rescale": [ + "Berendsen" + ], + "andersen": [ + "Andersen" + ], + "andersen-massive": [ + "Andersen" + ], + "nose-hoover": [ + "Nose-Hoover" + ] + } + }, + "path_metadata": {} + }, + "ld-seed": { + "by_path": { + "SimulationMetadata.settings.ensemble.random_seed": {} + }, + "path_metadata": {} + }, + "dt": { + "by_path": { + "SimulationMetadata.settings.integrator.time_step": {} + }, + "path_metadata": {} + }, + "barostat": { + "by_path": { + "SimulationMetadata.settings.barostat.barostat_algorithm": { + "1": [ + "Berendsen" + ], + "2": [ + "Monte Carlo" + ] + } + }, + "path_metadata": {} + }, + "compressibility": { + "by_path": { + "SimulationMetadata.settings.barostat.compressibility_vector": {} + }, + "path_metadata": {} + }, + "ref-p": { + "by_path": { + "SimulationMetadata.settings.barostat.target_pressure_vector": {} + }, + "path_metadata": {} + }, + "tau-p": { + "by_path": { + "SimulationMetadata.settings.barostat.pressure_time_constant": {} + }, + "path_metadata": {} + }, + "nstpcouple": { + "by_path": { + "SimulationMetadata.settings.barostat.pressure_coupling_frequency": {} + }, + "path_metadata": {} + }, + "pcoupltype": { + "by_path": { + "SimulationMetadata.settings.barostat.pressure_coupling_type": { + "isotropic": [ + "isotropic" + ], + "semiisotropic": [ + "semi-isotropic" + ], + "anisotropic": [ + "anisotropic" + ], + "surface-tension": [ + "surface tension" + ] + } + }, + "path_metadata": {} + }, + "ref-t": { + "by_path": { + "SimulationMetadata.settings.thermostat.target_temperature_vector": {} + }, + "path_metadata": {} + }, + "tau-t": { + "by_path": { + "SimulationMetadata.settings.thermostat.temperature_time_constant": {} + }, + "path_metadata": {} + }, + "nh-chain-length": { + "by_path": { + "SimulationMetadata.settings.thermostat.chain_length": {} + }, + "path_metadata": {} + }, + "bd-fric": { + "by_path": { + "SimulationMetadata.settings.thermostat.friction_coefficient": {} + }, + "path_metadata": {} + }, + "rcoulomb": { + "by_path": { + "SimulationMetadata.settings.interactions.electrostatic_cutoff_distance": {} + }, + "path_metadata": {} + }, + "rvdw": { + "by_path": { + "SimulationMetadata.settings.interactions.vdw_cutoff_distance": {} + }, + "path_metadata": {} + }, + "constraint-algorithm": { + "by_path": { + "SimulationMetadata.settings.interactions.bond_length_constraints_algorithm": { + "SHAKE": [ + "SHAKE" + ], + "LINCS": [ + "LINCS" + ] + } + }, + "path_metadata": {} + }, + "coulombtype": { + "by_path": { + "SimulationMetadata.settings.interactions.long_range_interaction_method": { + "Cut-off": [ + "Cutoff" + ], + "Ewald": [ + "Ewald" + ], + "PME": [ + "PME" + ], + "P3M-AD": [ + "P3M" + ], + "Reaction-Field": [ + "RF" + ] + } + }, + "path_metadata": {} + }, + "vdwtype": { + "by_path": { + "SimulationMetadata.settings.interactions.long_range_interaction_method": { + "Cut-off": [ + "Cutoff" + ], + "PME": [ + "PME" + ] + } + }, + "path_metadata": {} + }, + "Kinetic En.": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_kinetic_energy": {} + }, + "path_metadata": {} + }, + "Potential": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_potential_energy": {} + }, + "path_metadata": {} + }, + "Total Energy": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_enthalpy": {} + }, + "path_metadata": {} + }, + "Pressure (bar)": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_pressure": {} + }, + "path_metadata": {} + }, + "Temperature": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_temperature": {} + }, + "path_metadata": {} + }, + "Box-X": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_volume_vector": {} + }, + "path_metadata": {} + }, + "Box-Y": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_volume_vector": {} + }, + "path_metadata": {} + }, + "Box-Z": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_volume_vector": {} + }, + "path_metadata": {} + }, + "pbc": { + "by_path": { + "SimulationMetadata.trajectory.simulation_box.periodic_boundary_conditions": { + "False": [ + "None" + ], + "xyz": [ + "xyz" + ], + "xy": [ + "xy" + ] + } + }, + "path_metadata": {} + } + }, + "amber": { + "drms": { + "by_path": { + "SimulationMetadata.stages.minimisation.energy_tolerance": {} + }, + "path_metadata": {} + }, + "maxcyc": { + "by_path": { + "SimulationMetadata.stages.minimisation.number_of_minimisation_steps": {} + }, + "path_metadata": {} + }, + "dx0": { + "by_path": { + "SimulationMetadata.stages.minimisation.minimisation_distance_step_size": {} + }, + "path_metadata": {} + }, + "ntmin": { + "by_path": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "1": [ + "Steepest Descent", + "Conjugate Gradient" + ], + "2": [ + "Steepest Descent" + ], + "0": [ + "Conjugate Gradient" + ], + "3": [ + "XMIN" + ], + "4": [ + "LMOD" + ] + } + }, + "path_metadata": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "multivalued": true + } + } + }, + "imin": { + "by_path": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "0": [ + "None" + ] + } + }, + "path_metadata": { + "SimulationMetadata.stages.minimisation.minimisation_algorithm": { + "multivalued": true + } + } + }, + "ntb": { + "by_path": { + "SimulationMetadata.settings.ensemble.ensemble_type": { + "2": [ + "NPT" + ], + "1": [ + "NVT" + ], + "0": [ + "μVT" + ] + } + }, + "path_metadata": {} + }, + "ntt": { + "by_path": { + "SimulationMetadata.settings.ensemble.ensemble_type": { + "0": [ + "μVT" + ] + }, + "SimulationMetadata.settings.thermostat.thermostat_algorithm": { + "3": [ + "Langevin" + ], + "1": [ + "Berendsen" + ], + "2": [ + "Andersen" + ], + "9": [ + "Nose-Hoover" + ], + "10": [ + "Nose-Hoover" + ], + "11": [ + "Bussi" + ] + } + }, + "path_metadata": {} + }, + "ntp": { + "by_path": { + "SimulationMetadata.settings.ensemble.ensemble_type": { + "0": [ + "μVT" + ] + }, + "SimulationMetadata.settings.barostat.pressure_coupling_type": { + "1": [ + "isotropic" + ], + "3": [ + "semi-isotropic" + ], + "2": [ + "anisotropic" + ] + } + }, + "path_metadata": {} + }, + "ig": { + "by_path": { + "SimulationMetadata.settings.ensemble.random_seed": {} + }, + "path_metadata": {} + }, + "dt": { + "by_path": { + "SimulationMetadata.settings.integrator.time_step": {} + }, + "path_metadata": {} + }, + "nstlim": { + "by_path": { + "SimulationMetadata.settings.integrator.number_of_steps": {} + }, + "path_metadata": {} + }, + "comp": { + "by_path": { + "SimulationMetadata.settings.barostat.compressibility": {} + }, + "path_metadata": {} + }, + "pres0": { + "by_path": { + "SimulationMetadata.settings.barostat.target_pressure": {} + }, + "path_metadata": {} + }, + "taup": { + "by_path": { + "SimulationMetadata.settings.barostat.pressure_time_constant": {} + }, + "path_metadata": {} + }, + "temp0": { + "by_path": { + "SimulationMetadata.settings.thermostat.target_temperature": {} + }, + "path_metadata": {} + }, + "gamma_ln": { + "by_path": { + "SimulationMetadata.settings.thermostat.collision_frequency": {} + }, + "path_metadata": {} + }, + "nhc_chain_length": { + "by_path": { + "SimulationMetadata.settings.thermostat.chain_length": {} + }, + "path_metadata": {} + }, + "cut": { + "by_path": { + "SimulationMetadata.settings.interactions.electrostatic_cutoff_distance": {} + }, + "path_metadata": {} + }, + "ntc": { + "by_path": { + "SimulationMetadata.settings.interactions.bond_length_constraints_algorithm": { + "2": [ + "SHAKE" + ], + "3": [ + "SHAKE" + ] + } + }, + "path_metadata": {} + }, + "ew_type": { + "by_path": { + "SimulationMetadata.settings.interactions.long_range_interaction_method": { + "1": [ + "Ewald" + ], + "0": [ + "PME" + ] + } + }, + "path_metadata": {} + }, + "EKtot": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_kinetic_energy": {} + }, + "path_metadata": {} + }, + "EPtot": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_potential_energy": {} + }, + "path_metadata": {} + }, + "Etot": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_enthalpy": {} + }, + "path_metadata": {} + }, + "PRESS": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_pressure": {} + }, + "path_metadata": {} + }, + "TEMP(K)": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_temperature": {} + }, + "path_metadata": {} + }, + "VOLUME": { + "by_path": { + "SimulationMetadata.observables.simulation_averages.average_volume": {} + }, + "path_metadata": {} + } + }, + "lammps": { + "timestep": { + "by_path": { + "SimulationMetadata.settings.integrator.time_step": {} + }, + "path_metadata": {} + }, + "temp": { + "by_path": { + "SimulationMetadata.settings.thermostat.target_temperature": {} + }, + "path_metadata": {} + } + }, + "toptrajparser": { + "bonds": { + "by_path": { + "SimulationMetadata.topology.connectivity.bonds": {} + }, + "path_metadata": {} + }, + "dihedrals": { + "by_path": { + "SimulationMetadata.topology.connectivity.dihedrals": {} + }, + "path_metadata": {} + }, + "masses": { + "by_path": { + "SimulationMetadata.topology.particles.masses": {} + }, + "path_metadata": {} + }, + "fixed_charges": { + "by_path": { + "SimulationMetadata.topology.particles.fixed_charges": {} + }, + "path_metadata": {} + }, + "system_charge": { + "by_path": { + "SimulationMetadata.topology.particles.system_charge": {} + }, + "path_metadata": {} + }, + "coarse_grained": { + "by_path": { + "SimulationMetadata.topology.particles.coarse_grained": {} + }, + "path_metadata": {} + }, + "box_dimensions": { + "by_path": { + "SimulationMetadata.trajectory.simulation_box.box_dimensions": {} + }, + "path_metadata": {} + }, + "box_angles": { + "by_path": { + "SimulationMetadata.trajectory.simulation_box.box_angles": {} + }, + "path_metadata": {} + }, + "box_type": { + "by_path": { + "SimulationMetadata.trajectory.simulation_box.box_type": { + "cubic": [ + "Cubic" + ], + "tetragonal": [ + "Tetragonal" + ], + "orthorhombic": [ + "Orthorhombic" + ], + "truncated octahedron": [ + "Truncated Octahedron" + ], + "triclinic": [ + "Triclinic" + ] + } + }, + "path_metadata": {} + }, + "positions": { + "by_path": { + "SimulationMetadata.trajectory.trajectory_output.positions": {} + }, + "path_metadata": {} + }, + "forces": { + "by_path": { + "SimulationMetadata.trajectory.trajectory_output.forces": {} + }, + "path_metadata": {} + }, + "velocities": { + "by_path": { + "SimulationMetadata.trajectory.trajectory_output.velocities": {} + }, + "path_metadata": {} + }, + "water": { + "by_path": { + "SimulationMetadata.trajectory.trajectory_output.water": {} + }, + "path_metadata": {} + }, + "frame_count": { + "by_path": { + "SimulationMetadata.trajectory.trajectory_output.frame_count": {} + }, + "path_metadata": {} + }, + "total_molecule_count": { + "by_path": { + "SimulationMetadata.composition.system_counts.total_molecule_count": {} + }, + "path_metadata": {} + }, + "total_atom_count": { + "by_path": { + "SimulationMetadata.composition.system_counts.total_atom_count": {} + }, + "path_metadata": {} + }, + "unique_molecule_count": { + "by_path": { + "SimulationMetadata.composition.system_counts.unique_molecule_count": {} + }, + "path_metadata": {} + }, + "SMILES": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.SMILES": {} + }, + "path_metadata": {} + }, + "InChI": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.InChI": {} + }, + "path_metadata": {} + }, + "InChIKey": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.InChIKey": {} + }, + "path_metadata": {} + }, + "protein_sequence": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.protein_sequence": {} + }, + "path_metadata": {} + }, + "nucleic_sequence": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.nucleic_sequence": {} + }, + "path_metadata": {} + }, + "molecular_formula": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.molecular_formula": {} + }, + "path_metadata": {} + }, + "molecular_weight": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.molecular_weight": {} + }, + "path_metadata": {} + }, + "molecule_charge": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.molecule_charge": {} + }, + "path_metadata": {} + }, + "molecule_count": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.molecule_count": {} + }, + "path_metadata": {} + }, + "atom_count": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.atom_count": {} + }, + "path_metadata": {} + }, + "monomer_count": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.monomer_count": {} + }, + "path_metadata": {} + }, + "simulated_particle_names": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.simulated_particle_names": {} + }, + "path_metadata": {} + }, + "simulated_molecule_name": { + "by_path": { + "SimulationMetadata.composition.molecule_ID.simulated_molecule_name": {} + }, + "path_metadata": {} + } + } + } +} diff --git a/biosim_schema/utils/generate_artifacts.py b/biosim_schema/utils/generate_artifacts.py index 8d614c9..04cbd73 100644 --- a/biosim_schema/utils/generate_artifacts.py +++ b/biosim_schema/utils/generate_artifacts.py @@ -74,6 +74,16 @@ def webform_fields_path(self) -> Path: def engine_mappings_path(self) -> Path: return self.repo_root / "project" / "schema_enginemappings.json" + @property + def packaged_engine_mappings_path(self) -> Path: + return ( + self.repo_root + / "biosim_schema" + / "schema" + / "generated" + / "schema_enginemappings.json" + ) + @property def summary_yaml_path(self) -> Path: return self.repo_root / "project" / "schema_summary.yaml" @@ -175,6 +185,7 @@ def generate_engine_mappings(paths: ArtifactPaths) -> None: """Generate schema_enginemappings.json from compiled JSON-LD.""" result = MappingsExtractor(str(paths.jsonld_path)).extract() write_json(paths.engine_mappings_path, result) + write_json(paths.packaged_engine_mappings_path, result) def generate_summary(paths: ArtifactPaths) -> None: @@ -372,6 +383,7 @@ def main() -> None: files_to_check = [ paths.webform_fields_path, paths.engine_mappings_path, + paths.packaged_engine_mappings_path, paths.summary_yaml_path, paths.summary_csv_path, paths.jsonschema_path, diff --git a/biosim_schema/utils/paths.py b/biosim_schema/utils/paths.py new file mode 100644 index 0000000..62bc0b3 --- /dev/null +++ b/biosim_schema/utils/paths.py @@ -0,0 +1,11 @@ +from importlib import resources + + +def schema_yaml_path() -> str: + return str(resources.files("biosim_schema.schema") / "biosim_schema.yaml") + + +def engine_mappings_path() -> str: + return str( + resources.files("biosim_schema.schema.generated") / "schema_enginemappings.json" + ) From 922828f8b3c892e8f48a57be695b1bf9a37c3756 Mon Sep 17 00:00:00 2001 From: Jas Kalayan Date: Wed, 23 Sep 2026 20:34:02 +0100 Subject: [PATCH 2/2] add PyPI and conda recipe into release workflow --- .github/workflows/release.yaml | 88 ++++++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 1 + conda-recipe/meta.yaml | 47 ++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 conda-recipe/meta.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8168fb6..c686999 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -30,6 +30,13 @@ jobs: with: fetch-depth: 0 + - name: Get latest release from pip + id: latestreleased + run: | + PREVIOUS_VERSION=$(python -m pip index versions biosim-schema | grep "biosim-schema" | cut -d "(" -f2 | cut -d ")" -f1) + echo "pip_tag=$PREVIOUS_VERSION" >> "$GITHUB_OUTPUT" + echo $PREVIOUS_VERSION + - name: Ensure version is greater than latest git tag run: | NEW_VERSION="${{ github.event.inputs.version }}" @@ -226,3 +233,84 @@ jobs: --data-urlencode "to=announcements" \ --data-urlencode "topic=software releases" \ --data-urlencode "content=${CONTENT}" + + pypi: + name: make pypi release + needs: [tag, release] + runs-on: ubuntu-24.04 + steps: + + - name: checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: main + + - name: Set up Python + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: 3.14.7 + + - name: Install flit + run: | + python -m pip install --upgrade pip + python -m pip install "flit>=4,<5" + + - name: Build and publish + run: | + flit publish + env: + FLIT_USERNAME: __token__ + FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + + conda: + name: publish conda to anaconda.org + needs: [tag, release] + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: main + + - name: Set version in conda recipe + run: | + sed -i "s/^{% set version = \".*\" %}$/{% set version = \"${{ github.event.inputs.version }}\" %}/" conda-recipe/meta.yaml + grep '{% set version' conda-recipe/meta.yaml + + - name: Setup Conda (conda-forge only) + uses: conda-incubator/setup-miniconda@8ee1f361103df19b6f8c8655fd3967a8ecb162d5 # v4.0.1 + with: + miniforge-variant: Miniforge3 + python-version: "3.14.7" + auto-activate: true + activate-environment: base + conda-remove-defaults: true + channels: conda-forge + channel-priority: strict + + - name: Install build tools + shell: bash -l {0} + run: | + conda install -y conda-build anaconda-client + conda config --set anaconda_upload no + conda list conda-build + conda build --help + + - name: Build package + shell: bash -l {0} + env: + PIP_NO_INDEX: "0" + run: | + PKG_PATH=$(conda build conda-recipe --output) + echo "PKG_PATH=$PKG_PATH" >> "$GITHUB_ENV" + conda build conda-recipe + test -f "$PKG_PATH" + echo "Built: $PKG_PATH" + + - name: Upload to Anaconda + shell: bash -l {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + anaconda -t "$ANACONDA_API_TOKEN" upload "$PKG_PATH" --user CCPBioSim --force diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c007d38..149d339 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,7 @@ repos: - id: check-added-large-files - id: check-merge-conflict - id: check-yaml + exclude: ^conda-recipe/meta\.yaml$ - id: check-toml - id: end-of-file-fixer exclude: ^project/ diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml new file mode 100644 index 0000000..bc55daf --- /dev/null +++ b/conda-recipe/meta.yaml @@ -0,0 +1,47 @@ +{% set name = "biosim-schema" %} +{% set version = "1.0.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + path: .. + +build: + noarch: python + script: | + python -m pip install . -vv --no-deps + entry_points: + - biosim-schema-generate=biosim_schema.utils.generate_artifacts:main + +requirements: + host: + - python >=3.12 + - pip + - flit-core >=3.4,<4 + run: + - python >=3.12 + - linkml >=1.11.1,<2.0 + - linkml-runtime >=1.11.1,<2.0 + - check-jsonschema >=0.38.0,<1.0 + +test: + imports: + - biosim_schema + - biosim_schema.fieldextraction + + commands: + - biosim-schema-generate --help + +about: + home: https://github.com/CCPBioSim/biosim-schema + license: MIT + license_family: MIT + license_file: LICENSE + license_url: https://github.com/CCPBioSim/biosim-schema/blob/main/LICENSE + summary: Schema for biomolecular simulation metadata. + description: "BioSim Schema provides a LinkML-based, reusable metadata model for biomolecular simulation data, with tooling to validate terms and generate downstream artefacts for BioSimDR workflows. These docs are for schema users and contributors: they explain installation, day-to-day usage, contribution workflows, generation/CI behavior, and where to find the schema reference." + dev_url: https://github.com/CCPBioSim/biosim-schema + doc_url: https://biosim-schema.readthedocs.io/en/latest/ + doc_source_url: https://github.com/CCPBioSim/biosim-schema/blob/main/README.md