push
funcfind_yaml_in_folder(folder) → Path | NoneFind BuildInput YAML file in folder with priority ordering.
Priority order:
- <hash>.yaml (try to match folder name if it looks like a hash)
- build.yaml (common convention)
- Any other .yaml file (alphabetically sorted)
paramfolderPathDirectory to search for YAML files
Returns
Path | NonePath to YAML file if found, None otherwise
funcdetermine_simulation_status(folder) → strDetermine simulation status based on output files.
Status hierarchy (checked in this order):
- "completed": prod.gro exists
- "production": prod.xtc exists (but no prod.gro)
- "equilibrated": min.gro AND nvt.gro AND npt.gro all exist
- "build": valid build folder but no simulation outputs
Note
This function delegates to Simulation.status for consistency. For new code, prefer using Simulation(folder).status directly.
paramfolderPathSimulation directory to check
Returns
strStatus string ("completed", "production", "equilibrated", or "build")
funcload_models_from_csv(csv_path) → tuple[list[BuildInput], dict[int, str]]Load BuildInput models from CSV file.
paramcsv_pathPathPath to CSV file
Returns
tupleTuple of (models, errors) where errors is a dict mapping row indices to error messages
funcsearch_folders_for_hash(hash_value, base_path=Path('.')) → Path | NoneRecursively search for a folder matching the given hash.
Searches for directories named exactly as the hash value.
paramhash_valuestrHash string to search for (folder name)
parambase_pathPath= Path('.')Starting directory for recursive search, by default Path(".")
Returns
Path | NonePath to matching folder if found, None otherwise
funcdiscover_simulation_folders(source=None, csv=None, csv_root=None) → list[tuple[Path, BuildInput]]Discover and validate simulation folders from various input modes.
Exactly one of source or csv must be provided.
paramsourcePath= NoneDirectory path, glob pattern, or summary YAML file (auto-detected)
paramcsvPath= NoneCSV file with build specifications
paramcsv_rootPath= NoneRoot directory to search for hash folders when csv is provided
Returns
listList of (folder_path, build_input) tuples for valid simulations
funcprepare_upload_data(simulations) → list[dict[str, Any]]Convert simulation list to database records.
paramsimulationslist[tuple[Path, BuildInput]]List of (folder_path, build_input) tuples
Returns
listList of database records ready for upload
funcupload_simulations(records, db_type='RUN_DATABASE', force=False, diff=False) → intUpload records to database with duplicate handling.
paramrecordslist[dict[str, Any]]Database records to upload
paramdb_typestr= 'RUN_DATABASE'Database type to upload to, by default "RUN_DATABASE"
paramforcebool= FalseDelete existing records before uploading, by default False
paramdiffbool= FalseOnly upload records not already in database, by default False
Returns
intfuncpush_systems(source=None, csv=None, csv_root=None, force=False, diff=False) → intPush simulation metadata to RUN_DATABASE.
Discovers simulation folders and uploads their metadata to the database.
paramsourcePath= NoneDirectory path, glob pattern, or summary YAML file (auto-detected)
paramcsvPath= NoneInput CSV file (hashes will be extracted and folders searched)
paramcsv_rootPath= NoneRoot directory to search for hash folders when using --csv mode
paramforcebool= FalseDelete existing records before uploading, by default False
paramdiffbool= FalseOnly upload records not already in database, by default False
Returns
intNumber of records uploaded
funcget_placeholder_record() → dict[str, Any]Create a placeholder record with correct schema for initialization.
Returns
dict[str, typing.Any]funcinit_systems_database(reset=False) → dict[str, bool]Initialize RUN_DATABASE.
Creates the database table (SQLite) or Foundry dataset based on config.
paramresetbool= FalseIf True, drop and recreate even if it exists. By default False.
Returns
dict{table_name: was_created}
