How himoto/hillfit works
Project type and purpose
• This is an open-source Python library (hillfit) for fitting experimental or modeled data to the Hill equation.
• It provides a single core class (HillFit) with methods for performing nonlinear regression (via SciPy), generating/visualizing figures (via Matplotlib), and exporting results (to the file system).
File structure
• Top-level folders
• .github/workflows: CI pipelines for tests, security scans, PyPI publish
• examples/: sample data & Jupyter notebook demonstrating usage
• hillfit/: the library source (init + fitting.py)
• test/: unit tests for the fitting logic
• Configuration & packaging
• pyproject.toml, setup.py, requirements.txt
• Pre-commit and style configs
• No “frontend” or “backend” directories – this is purely a library/tool.
README for additional insights
• Describes HillFit class API, parameters for calling fitting() and export()
• Mentions core dependencies: scipy.optimize.curve_fit, matplotlib, numpy
• Shows example usage in code and Jupyter notebook
Components
a. Main components
• User environment (Python REPL, IDE, Jupyter)
• hillfit library
• HillFit class
• fitting() sub-module
• export() sub-module
• External libraries
• NumPy (data arrays)
• SciPy (curve_fit)
• Matplotlib (plotting)
• File System (examples/raw_data.csv, export folder)
• CI/CD pipeline (GitHub Actions → PyPI)
b. Relationships & data flows
• User → imports hillfit → constructs HillFit(x_data,y_data)
• HillFit.fitting()
• reads x_data/y_data
• calls SciPy curve_fit
• produces fitted parameters & x_fit/y_fit
• calls Matplotlib to generate figs
• Results → accessible as object attrs (hf.top, hf.nH, hf.equation, hf.figure)
• HillFit.export() → writes files (CSV, equation.txt, image) to disk
• Developer push → GitHub → triggers workflows (tests, codeql, pre-commit) → PyPI publish
c. Architectural patterns and design principles
• Single-responsibility: HillFit handles data + fitting + export
• Dependency inversion: underlying numeric libraries are swappable via curve_fit_kws
• Modular separation: core logic (hillfit/) vs. examples vs. tests vs. CI
d. Technologies, frameworks, libraries
• Python packaging: setuptools/pyproject
• SciPy, NumPy, Matplotlib
• GitHub Actions, pre-commit, isort, black