Reorganization for install with pip or conda#59
Draft
d-montgomery wants to merge 48 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR reorganizes FuelLib for installation via pip/conda by introducing a fuellib package with embedded data, modern CLI exporters, and updated documentation/CI to use editable installs and new entry points.
Changes:
- Migrate tutorials/tests/export scripts to import
fuelliband locate data via package helpers instead ofpaths.py/sys.pathhacks. - Add packaging metadata (
pyproject.toml), embedded data underfuellib/data, and CLI entry points (fl-export-*,fl-build-docs, etc.). - Update Sphinx docs and GitHub Actions workflows to use the new CLI and editable installs.
Reviewed changes
Copilot reviewed 80 out of 81 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tutorials/mixtureProperties.py | Switch tutorial to fuellib import and embedded data directory lookup |
| tutorials/hefaBlends.py | Switch tutorial to fuellib import and embedded data directory lookup |
| tutorials/compositionPlots.py | Switch tutorial to fuellib import (remove path hacks) |
| tutorials/basic.py | Switch tutorial to fuellib import |
| tests/test_source_docstrings.py | Update docstring contract test to check selected fuellib modules/scripts |
| tests/test_api.py | Switch tests to fuellib import (remove path hacks) |
| tests/test_accuracy.py | Replace paths.py usage with explicit baseline directory constants |
| tests/get_pred_and_data.py | Switch helper to fuellib and embedded data locator |
| source/FuelLib.py | Refactor data directory handling to use embedded data locator functions |
| source/Export4Pele.py | Migrate exporter to fuellib, default embedded data, and updated CLI args/docs |
| source/Export4Converge.py | Migrate exporter to fuellib, default embedded data, and updated CLI args/docs |
| pyproject.toml | Add packaging metadata, dependencies, extras, and CLI entry points |
| paths.py | Remove legacy hardcoded path helper module |
| gcmTableData/gcmTable.csv | Update MW row in legacy GCM table CSV |
| fuellib/format_code.py | Add fl-format CLI utility |
| fuellib/exporters/init.py | Add exporters subpackage init |
| fuellib/data/gcmTableData/gcmTable.csv | Add embedded GCM table data CSV |
| fuellib/data/gcmTableData/init.py | Add embedded data package marker |
| fuellib/data/fuelData/refCompounds.csv | Add embedded reference compounds table |
| fuellib/data/fuelData/propertiesData/posf11498.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/posf10325.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/posf10289.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/posf10264.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/heptane.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/hefa-jet-a-blends.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/hefa-WE-SAF-262714.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/hefa-S1.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/dodecane.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/decane.csv | Add embedded properties dataset |
| fuellib/data/fuelData/propertiesData/init.py | Add embedded data package marker |
| fuellib/data/fuelData/groupDecompositionData/posf11498.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/heptane.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/heptane-decane.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/hefa-WE-SAF-262714.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/hefa-S1.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/dodecane.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/decane.csv | Add embedded decomposition dataset |
| fuellib/data/fuelData/groupDecompositionData/init.py | Add embedded data package marker |
| fuellib/data/fuelData/gcData/posf4658_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/posf11498_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/posf10325_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/posf10289_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/posf10264_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/posf10264_T30_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/jet-a_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/heptane_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/heptane-decane_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/hefa-tall_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/hefa-mfat_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/hefa-came_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/hefa-WE-SAF-262714_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/hefa-S1_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/dodecane_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/decane_init.csv | Add embedded GC dataset |
| fuellib/data/fuelData/gcData/init.py | Add embedded data package marker |
| fuellib/data/fuelData/dataReferences.md | Add embedded data provenance documentation |
| fuellib/data/fuelData/init.py | Add embedded data package marker |
| fuellib/data/init.py | Add embedded data package marker |
| fuellib/clean_docs.py | Add fl-clean-docs CLI utility |
| fuellib/build_docs.py | Add fl-build-docs CLI utility |
| fuellib/_data_locator.py | Add helper functions to locate embedded data directories |
| docs/tutorials.rst | Update tutorials toctree entries for renamed exporter docs |
| docs/tutorials-export4pele.rst | Update exporter tutorial to new fl-export-pele command and flags |
| docs/tutorials-export4converge.rst | Update exporter tutorial to new fl-export-converge command and flags |
| docs/tutorials-basic.rst | Update basic tutorial for pip install fuellib workflow |
| docs/sourcecode.rst | Update source layout documentation and public API reference |
| docs/index.rst | Add installation section and update toctree |
| docs/fuelprops.rst | Update API references from FuelLib to fuellib and clarify Cp/Cl terminology |
| docs/development.rst | Add contributing/development workflow documentation |
| docs/conf.py | Update Sphinx import path to project root |
| README.md | Update install instructions, CLI usage, and dev workflow |
| .gitignore | Ignore exportData/ and common Python build/venv artefacts |
| .github/workflows/documentation.yml | Switch docs build to editable dev install + fl-build-docs |
| .github/workflows/ci.yml | Switch CI installs to editable install and run new CLI exporters |
Comments suppressed due to low confidence (4)
fuellib/format_code.py:1
- This implementation depends on Unix utilities (
find,xargs) and will fail on Windows runners/environments. For a cross-platformfl-format, consider invoking Black viapython -m blackwith explicit paths, or enumerate files in Python (e.g.,pathlib.Path.rglob) and pass them to Black without relying on external shell tools.
tests/test_source_docstrings.py:1 - This test used to scan all
source/*.py, but now it checks a fixed allowlist and silently skips missing files. That weakens the contract (new modules won’t be checked, and missing expected files won’t fail the test). Consider discovering modules dynamically (e.g., globbingfuellib/**/*.pywith exclusions), and/or failing the test if any expected allowlisted file is missing.
tests/test_source_docstrings.py:1 - This test used to scan all
source/*.py, but now it checks a fixed allowlist and silently skips missing files. That weakens the contract (new modules won’t be checked, and missing expected files won’t fail the test). Consider discovering modules dynamically (e.g., globbingfuellib/**/*.pywith exclusions), and/or failing the test if any expected allowlisted file is missing.
gcmTableData/gcmTable.csv:1 - There are now two GCM table CSVs in the repo: the legacy
gcmTableData/gcmTable.csv(updated MW values here) and the embeddedfuellib/data/gcmTableData/gcmTable.csv(which still has the old integer MW row). Since the refactor switches runtime lookup to the embedded data, this creates a risk of inconsistent results depending on which table is used. Please ensure the embedded CSV is updated consistently (or remove/stop updating the legacy copy) so there is a single source of truth.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Rewrite tutorials-custom-fuels.rst for clarity - Add fuel_metadata requirement - Update error messages and fuel manager - Add fl-fuels command to README - Add testing for fuels shipped with FuelLib
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
- Rename posf10264.csv to posf-cat-a.csv (Conventional ATM Surrogate) - Delete duplicate files: posf4658.csv, posf10289.csv, posf10325.csv (verified identical via checksum: 4026242a7a35eba58a47f3e9a38a025e) - Update fuel_metadata.yaml to point all four conventional POSF fuels to the consolidated posf-cat-a decomposition file - Reduces groupDecompositionData/ from 14 to 11 files - All fuels remain discoverable via CLI and API - Verified: test_api.py passes, fl-fuels lists all 13 fuels correctly, all five POSF fuels (posf4658, posf10264, posf10289, posf10325, posf11498) instantiate successfully - posf11498 (ATJ, isoparaffinic) remains separate as unique composition This change improves maintainability by eliminating file duplication while preserving distinct fuel metadata (names, sources, descriptions) through the fuel_metadata.yaml mapping.
- Remove unnecessary re-exports of C2K, K2C, get_props_data_from_metadata from main fuellib module (kept API clean) - Update plotting.py to directly import: - C2K, K2C from fuellib.convert - get_props_data_from_metadata from fuellib._data_locator - Replace all fl.* calls with direct function names - This is cleaner than polluting the main API with internal CLI utilities - Fixes: fl-plt-props -f posf10325 now works correctly
- Follows pattern of other data locator functions: get_fueldata_dir, get_fueldata_gc_dir, get_fueldata_decomp_dir, get_fueldata_props_dir, get_gcmtable_dir - get_fueldata_propsdata returns properties data name from fuel_metadata - Updated across _data_locator.py, __init__.py, and plotting.py
- Remove k_B and N_A from top-level (access via fl.constants.k_B, fl.constants.N_A) - Use 'from ._data_locator import *' instead of explicit function list - Add __all__ to _data_locator.py to control what gets exported - Cleaner and more consistent with submodule pattern (fl.convert.*, fl.constants.*, fl.utility.*) - Keep only essential items at top level: fuel, submodules (constants, convert, utility)
- Not exported in __all__, so import was dead code - Access via fl.constants.k_B, fl.constants.N_A when needed
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 96 out of 113 changed files in this pull request and generated 9 comments.
Comments suppressed due to low confidence (2)
docs/tutorials-export-pele.rst:151
- The short option in the example uses
-d, but the actual exporter CLI defines-dep/--dep_fuel_names(seefuellib/exporters/pele.py). As written,fl-export-pele -f heptane-decane -d ...will fail with an unrecognized argument; update the docs example to use-dep(or the long option).
docs/tutorials-export-pele.rst:156 - The sample output uses
particles.dep_fuel_names, but the exporter writesparticles.dep_fuel_species(seefuellib/exporters/pele.py). Update the documentation snippet to match the actual key name so users can copy/paste it into Pele inputs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes several improvements to the FuelLib project's installation, documentation, and CI workflows. The main changes include updating installation instructions and documentation to reflect new CLI tools and development workflows, switching CI and documentation builds to use editable/development installs, and modernizing the command-line exporter interface. Additionally, a new development guide has been added along a tutorial for using user defined custom fuels.
Major Changes
Installation
Users can now install FuelLib through
pip install fuellib, then addingimport fuellib as flto any python script that utilizes FuelLib.Module Organization & Architecture
FuelLib.pyinto modules:constants.py- Physical constants (k_B, N_A)convert.py- Temperature and unit conversionsutility.py- Mixture properties and droplet calculationsfuel.py- Main Fuel class for GCM calculationssource->fuelliband added apyproject.tomlfor distribution via pip and conda with proper entry point configurationfuellib/cli/subpackage containing all command-line toolspip install -e .,pip install -e '.[dev]', andpip install fuellibimport fuellib as flprovided apip install.fuel_metadata.yamlrequirement:CLI Tools Expansion & Organization
New CLI Commands:
fl-C2K,fl-K2C- Celsius/Kelvin conversion utilitiesfl-C2F,fl-F2C,fl-F2K,fl-K2F- Additional temperature conversionsfl-eps2K- Lennard-Jones epsilon to characteristic temperature conversionfl-export-converge- Export mixture properties for Converge CFD simulationsfl-export-pele- Export properties for PelePhysics simulationsfl-plt-comp- Composition plottingfl-plt-props- Properties plottingfl-fuels- List available fuels with metadata supportTesting Improvements
test_exporters.py: Comprehensive integration tests for export commands (7 tests)test_source_docstrings.py: Now validates docstrings for all public API modulestest_utilities.py- Unit tests for utility functions and CLI temperature conversion commandstest_hc_identification.py- Unit tests for hydrocarbon classification logictest_exporters.pycallBreaking Changes (v3.0.0)
Functions moved from
fuellibnamespace to submodules:fl.C2K()→fl.convert.C2K()fl.mixing_rule()→fl.utility.mixing_rule()fl.k_Bstill works, butfl.constants.k_BrecommendedRequirement of
fuel_metadata.yaml