{"id":50382491,"url":"https://github.com/vitaliy-ch25/melafit","last_synced_at":"2026-05-30T13:00:37.205Z","repository":{"id":352404423,"uuid":"1214999173","full_name":"vitaliy-ch25/melafit","owner":"vitaliy-ch25","description":"melafit: High-precision 24h melatonin profile analysis. Features bimodal skewed baseline cosine fitting (Van Someren \u0026 Nagtegaal, 2007) and a robust cost function (Gabel et al., 2017) for superior convergence, even with sparse data.","archived":false,"fork":false,"pushed_at":"2026-05-28T20:57:18.000Z","size":242,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-28T22:14:45.857Z","etag":null,"topics":["baseline-cosine-function","bimodal-baseline-cosine-function","bimodal-skewed-baseline-cosine-function","circadian-phase","circadian-rhythm","curve-fitting","melatonin","melatonin-phase","nonlinear-constrained-optimization","python","skewed-baseline-cosine-function","waveform-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitaliy-ch25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-19T10:45:56.000Z","updated_at":"2026-05-24T08:27:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vitaliy-ch25/melafit","commit_stats":null,"previous_names":["vitaliy-ch25/melafit"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/vitaliy-ch25/melafit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitaliy-ch25%2Fmelafit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitaliy-ch25%2Fmelafit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitaliy-ch25%2Fmelafit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitaliy-ch25%2Fmelafit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitaliy-ch25","download_url":"https://codeload.github.com/vitaliy-ch25/melafit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitaliy-ch25%2Fmelafit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33692997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baseline-cosine-function","bimodal-baseline-cosine-function","bimodal-skewed-baseline-cosine-function","circadian-phase","circadian-rhythm","curve-fitting","melatonin","melatonin-phase","nonlinear-constrained-optimization","python","skewed-baseline-cosine-function","waveform-analysis"],"created_at":"2026-05-30T13:00:33.845Z","updated_at":"2026-05-30T13:00:37.190Z","avatar_url":"https://github.com/vitaliy-ch25.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# melafit\n\nPython package for **high-precision circadian melatonin profile analysis.** \nFeatures a variety of baseline cosine functions for curve fitting \n([Van Someren \u0026 Nagtegaal, 2007](https://doi.org/10.1016/j.sleep.2007.03.012)) \nand a robust cost function for superior convergence, even with sparse data \n([Gabel et al., 2017](https://doi.org/10.1038/s41598-017-07060-8)).\n\n## Overview\n\n[melafit](https://github.com/vitaliy-ch25/melafit) is a Python package \ndesigned for high-precision modeling of 24-hour melatonin secretion. While \nstandard cosinor or harmonic analyses fail to capture the physiological \nnuances of the melatonin \"wave,\" \n[melafit](https://github.com/vitaliy-ch25/melafit) implements several \n**baseline cosine functions** including bimodal, skewed and bimodal-skewed \nmodifications. This approach accounts for the characteristic baseline, \nasymmetry and dual peaks often seen in high-resolution circadian melatonin \ndata.\n\nFurthermore, the library utilizes a **specialized cost function** developed\nto overcome common optimization hurdles (trivial all-zero solutions),\nensuring stable convergence even when working with sparse or incomplete\ntime series.\n\n## Key Features\n\n* **Bimodal Waveform Fitting:** Implementation of the \n  [Van Someren \u0026 Nagtegaal (2007)](https://doi.org/10.1016/j.sleep.2007.03.012) \n  model for superior physiological accuracy.\n* **Optimized Convergence:** Leverages the robust cost function described in \n  [Gabel et al. (2017)](https://doi.org/10.1038/s41598-017-07060-8) to ensure \n  reliable fits across diverse datasets.\n* **Sparse Data Support:** Capable of reconstructing full profiles and\n  estimating circadian phase from limited data points, as well as\n  determining dim light melatonin onset (DLMO) with partial data.\n* **Research-Ready:** Direct derivation of `Amplitude`, `DLMOn`,\n  `DLMOff`, `Midpoint`, `Area` and `COG` markers from continuous,\n  fitted waveforms.\n\n## Installation\n\n`melafit` is available on [PyPI](https://pypi.org/project/melafit/) and can be \ninstalled with `pip`. However, installing directly into your system Python \nenvironment without a virtual environment is strongly discouraged, as it may \ncause conflicts with other packages. The recommended approach is to use \n[miniforge](https://conda-forge.org/download/) as the package and environment \nmanager to create a dedicated virtual environment, as described below.\n\n### Standard installation\n\nDownload file \n[`melafit.yml`](https://github.com/vitaliy-ch25/melafit/blob/main/melafit.yml) \nto a directory of your choice (`\u003cYOUR-DIRECTORY\u003e`). Navigate to the directory, \ncreate and activate the conda environment:\n\n```bash\ncd \u003cYOUR-DIRECTORY\u003e\nconda env create -f melafit.yml\nconda activate melafit\n```\n\nThe environment configuration file \n[`melafit.yml`](https://github.com/vitaliy-ch25/melafit/blob/main/melafit.yml) \nuses `conda-forge` as the sole package channel, ensuring reproducibility and \navoiding potential conflicts between packages from different channels. \n`melafit` itself is installed from [PyPI](https://pypi.org/project/melafit/) \nvia `pip` as part of the environment setup. This will create a fully \nfunctional analysis environment, including all supporting packages (`numpy`, \n`scipy`, `pandas`, `openpyxl` and `matplotlib`).\n\n### Developer installation\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand\u003c/strong\u003e\u003c/summary\u003e\n\nIf you intend to follow the development closely or contribute to the\npackage, clone the repository first to a dedicated directory\n`\u003cYOUR-DIRECTORY\u003e`. Navigate to it and clone the repository as follows:\n\n```bash\ncd \u003cYOUR-DIRECTORY\u003e\ngit clone https://github.com/vitaliy-ch25/melafit.git\ncd melafit\n```\n\nThen create and activate the conda environment using the developer \nconfiguration file \n[`melafit-dev.yml`](https://github.com/vitaliy-ch25/melafit/blob/main/melafit-dev.yml), \nwhich installs `melafit` directly from the cloned directory in editable mode:\n\n```bash\nconda env create -f melafit-dev.yml\nconda activate melafit\n```\n\nWith an editable install, any changes to the source code in the cloned\ndirectory take effect immediately without reinstalling the package.\n\n\u003c/details\u003e\n\n## Updating\n\n### Standard update\n\nDownload the latest \n[`melafit.yml`](https://github.com/vitaliy-ch25/melafit/blob/main/melafit.yml) \nto `\u003cYOUR-DIRECTORY\u003e`. Navigate to it and run the update command as follows:\n\n```bash\ncd \u003cYOUR-DIRECTORY\u003e\nconda env update -f melafit.yml --prune\n```\n\nThis updates both the dependencies and `melafit` itself to the latest\nreleased version.\n\n### Developer update\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand\u003c/strong\u003e\u003c/summary\u003e\n\nNavigate to the cloned repository directory and pull the latest version\nfrom the main branch:\n\n```bash\ncd \u003cYOUR-DIRECTORY\u003e/melafit\ngit pull\n```\n\nThe editable install picks up the changes immediately. If dependencies in \n[`melafit-dev.yml`](https://github.com/vitaliy-ch25/melafit/blob/main/melafit-dev.yml) \nhave changed, also run:\n\n```bash\nconda env update -f melafit-dev.yml --prune\n```\n\nThis updates both the dependencies and the `melafit` package itself to\nthe latest version.\n\n\u003c/details\u003e\n\n## Getting Started\n\nCode examples and some dummy data demonstrating melatonin profile curve \nfitting with this package are included in \n[./examples/](https://github.com/vitaliy-ch25/melafit/blob/main/examples/) and \n[./data/](https://github.com/vitaliy-ch25/melafit/blob/main/data/). Copy \nsample scripts and datasets to your working directory and start from there. If \nyou have performed the steps above as described, your script will 'see' all \nthe required packages from any location. Simply make sure to use the virtual \nenvironment `melafit` you created.\n\n### Minimal example — fit a single participant and compute area/COG\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand\u003c/strong\u003e\u003c/summary\u003e\n\n```python\nimport os\nimport matplotlib.pyplot as plt\nfrom matplotlib import dates\nimport melafit as mf\n\n# Read full profile data from Excel spreadsheet\ndata = mf.read_data(\"./data/dummy_data_full.xlsx\")\n\n# Prepare results directory and collector\nresult_path = \"./results/one_fit/\"\nos.makedirs(result_path, exist_ok=True)\ncollector = mf.ResultsCollector()\n\nparticipant = 1\n\n# Prepare data for the participant\np_data = mf.prepare_part_data(data, participant)\n\n# Fit curve and compute resampled waveform\nres = mf.fit(p_data.Timestamp, p_data.Mel, mf.bsbcf)\nresampled_t = mf.gen_time_range(p_data.Timestamp, step=\"1min\")\nresampled_f = mf.bsbcf(t=resampled_t, p=res)\n\n# Compute area and COG\nac = mf.area_cog(resampled_t, resampled_f)\n\n# Collect all results for this participant\nmeta = mf.SessionInfo(p_data)\ncollector.add(meta, ac)\n\n# Print summary\nprint(meta)\nprint(res)\nprint(ac)\n\n# Visualize results\ntitle_str = (f\"{meta}, {ac}, R²={res.r2:.3f}\")\n\nplt.close(\"all\")\nplt.figure(figsize=(12, 5))\nplt.scatter(p_data.Timestamp, p_data.Mel, c='b')\nplt.plot(resampled_t, resampled_f, 'g')\nplt.xlabel(\"Time, hh:mm\")\nplt.gca().xaxis.set_major_formatter(dates.DateFormatter('%H:%M'))\nplt.ylabel(\"Concentration, pg/ml\")\nplt.title(title_str)\nplt.legend([\"Melatonin data\", \"BSBCF curve\"])\nplt.savefig(result_path + f\"mel_data_{participant}_BSBCF.png\")\n\n# Keep the figure open until a button is pressed\nplt.waitforbuttonpress()\n\n# Save results to Excel file\ncollector.save(result_path, \"results_one_fit_BSBCF.xlsx\")\n```\n\nRunning this code contained in [example_one_fit.py](https://github.com/vitaliy-ch25/melafit/blob/main/examples/example_one_fit.py) produces the following text output in the terminal\n\n```bash\nParticipant=1, 2026-03-19 12:00 – 2026-03-20 12:00\nFitted function: BSBCF, parameters: phi=0.108, b=1.650, H=65.766, c=0.235, v=0.185, m=0.198, R²=0.9978\n```\n\nand the following figure is displayed with a fitted BSBCF waveform and the data it was fitted to. Besides that, the results are stored to an Excel table `results_one_fit_BSBCF.xlsx` under `./results/one_fit/`.\n\n![Example output](https://raw.githubusercontent.com/vitaliy-ch25/melafit/main/assets/example_one_fit.png)\n\n\u003c/details\u003e\n\n### Data preparation\n\nFollow the Excel table format and column naming conventions as in \n[./data/](https://github.com/vitaliy-ch25/melafit/blob/main/data/):\n* *Participant* for study participant ID\n* *Date* for dates of the respective samples\n* *Time* for sample timestamps \n* *Mel* for melatonin level values\n\n## Scientific Foundations\n\nIf you use [melafit](https://github.com/vitaliy-ch25/melafit) in your \nresearch, please cite the following foundational publications:\n\n### Human-Readable\n1. [Van Someren, E. J., \u0026 Nagtegaal, E. (2007). Improving melatonin circadian phase estimates. Sleep Medicine, 8(6), 590-601.](https://doi.org/10.1016/j.sleep.2007.03.012)\n2. [Gabel, V., et al. (2017). Differential impact in young and older individuals of blue-enriched white light on circadian physiology and alertness during sustained wakefulness. Scientific Reports, 7, 7620.](https://doi.org/10.1038/s41598-017-07060-8)\n\n### BibTeX\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand\u003c/strong\u003e\u003c/summary\u003e\n\n```bibtex\n@article{vansomeren2007,\n  title={Improving melatonin circadian phase estimates},\n  author={Van Someren, Eus JW and Nagtegaal, Elsbeth},\n  journal={Sleep Medicine},\n  volume={8},\n  number={6},\n  pages={590--601},\n  year={2007},\n  publisher={Elsevier}\n}\n\n@article{gabel2017,\n  title={Differential impact in young and older individuals of\n         blue-enriched white light on circadian physiology and alertness\n         during sustained wakefulness},\n  author={Gabel, Virginie and Reichert, Carolin F and Maire, Micheline\n          and Schmidt, Christina and Schlangen, Luc JM\n          and Kolodyazhniy, Vitaliy and Garbazza, Corrado\n          and Cajochen, Christian and Viola, Antoine U},\n  journal={Scientific Reports},\n  volume={7},\n  pages={7620},\n  year={2017},\n  publisher={Nature Publishing Group}\n}\n```\n\u003c/details\u003e\n\nIf there is no associated publication on `melafit` yet, please cite the\npackage directly using the following reference:\n\n```text\nKolodyazhniy, V., Cajochen, C. (2026). melafit: High-precision circadian \nmelatonin profile analysis (Version x.y.z). [Computer software]. \nAvailable at https://github.com/vitaliy-ch25/melafit (Accessed: dd mmm yyyy).\n```\n\n## Authors\n\n* Vitaliy Kolodyazhniy – Lead Developer\n* Christian Cajochen – Scientific Lead\n\n## Revision History\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eClick to expand\u003c/strong\u003e\u003c/summary\u003e\n\n### [v0.4.1](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.4.1) - Bugfix and documentation polish\n- `ResultsCollector.save()` now appends `.xlsx` only when the supplied \n  filename does not already end with `.xlsx`, preventing double-extension \n  filenames such as `results.xlsx.xlsx`\n- Unit test `test_save_filename_with_xlsx_extension` added to verify that a \n  filename passed with `.xlsx` already present is written without modification\n- Docstrings improved in `markers.py` and `results.py`\n- README: collapsible sections added for BibTeX citation block, Revision \n  History, Developer installation, and Developer update; section captions and \n  markup refined; recommended package/environment manager updated to \n  [Miniforge](https://github.com/conda-forge/miniforge)\n- `midpoint()` now raises `ValueError` with a descriptive message (data range \n  and threshold value included) when the threshold is never crossed, replacing \n  a silent `IndexError`\n- `area_cog()` now raises `ValueError` with a descriptive message when the \n  baseline is never crossed from below, or when the area under the curve is \n  zero\n- `prepare_part_data()` issues `warnings.warn()` instead of `print()` when \n  correcting a duplicate timestamp, so the message integrates with standard \n  Python warning filters\n- Unused imports removed from `markers.py` (`phase_to_string`) and \n  `utils.py` (`os`, `scipy.optimize`)\n- Unit tests added: `test_threshold_never_crossed_raises` (`TestMidpoint`), \n  `test_baseline_never_crossed_raises` and `test_zero_area_raises` \n  (`TestAreaCog`)\n- `pyproject.toml`: `keywords`, `classifiers`, and `Documentation` URL added\n\n### [v0.4.0](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.4.0) - Improved API and examples\n- `AmplitudeResult` now includes a `baseline` field (waveform minimum)\n- `ResultsCollector` records and Excel output now include the `baseline` column\n- `__str__()` added to all `AnalysisRecord` subclasses for human-readable\n  `print()` output:\n  - `SessionInfo`: participant name and session date/time range\n  - `AmplitudeResult`: amplitude and baseline values\n  - `MidpointResult`: DLMOn, DLMOff and Midpoint times\n  - `AreaCogResult`: area and COG time\n  - `FitResult`: function name, parameters and R²\n  - `AnalysisRecord` base: generic fallback derived from `to_dict()`\n- Example scripts updated to use `print(meta)`, `print(res)`,\n  `print(mid, ac)` directly via the new `__str__` representations\n- Unit tests extended to cover the new `baseline` field and `ResultsCollector`\n  column\n- All example scripts simplified to `import melafit as mf` (single top-level\n  import replaces multiple `from melafit.xxx import ...` lines)\n- New minimal getting-started example `example_one_fit.py`: single-participant\n  fit with `bsbcf`, `area_cog`, result collection, plot and Excel export\n- `os.makedirs(result_path, exist_ok=True)` added to `example_dlmo.py` and\n  `example_full_profile.py` so result directories are created automatically\n- README: collapsible getting-started example with output figure added to the\n  Getting Started section\n- Version is now managed in a single source of truth: `melafit/_version.py`\n  contains `__version__`; `pyproject.toml` uses `dynamic = [\"version\"]` with\n  `[tool.setuptools.dynamic]` pointing to `melafit._version.__version__`;\n  `melafit/__init__.py` imports and re-exports `__version__` from `._version`\n- Fixed citation author in module docstring: \"Ruf et al. (1992)\" → \"Ruf (1992)\"\n\n### [v0.3.0](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.3.0) - Cleaner API\n- `AnalysisResult` renamed to `AnalysisRecord`\n- `AnalysisInfo` renamed to `SessionInfo`; describes the data acquisition\n  session only (`participant`, `start`, `end`); `func` and `r2` removed\n- `SessionInfo` constructor simplified: accepts a single `p_data` DataFrame\n  (as returned by `prepare_part_data()`); `participant`, `start` and `end`\n  are derived automatically\n- `FitResult.to_dict()` now includes `func` (waveform function name) and `r2`\n  (R² goodness of fit), both computed automatically at the end of `fit()`\n- `r2` is no longer a field of `SessionInfo`; `fit()` computes and stores it\n  in `FitResult` directly\n- `compute_wave()` eliminated; replaced by the `gen_time_range()` +\n  waveform-function pattern: `gen_time_range()` accepts a Timestamp series or\n  explicit `tmin`/`tmax` bounds and a pandas offset string for `step`, and\n  returns a time axis as float days since the Unix UTC epoch, which is\n  then passed directly to the waveform function (e.g.\n  `bsbcf(t=gen_time_range(series, step=\"1min\"), p=fit_result)`)\n- New helper `to_days()` converts timestamps to float days since the Unix UTC\n  epoch; timezone-naive input is treated as UTC, timezone-aware input is\n  converted to UTC first\n- New helper `from_days()` is the inverse of `to_days()`; returns a\n  UTC-aware `pd.DatetimeIndex`\n- `day_profile()`, `midpoint()` and `area_cog()` now accept a float days\n  array (as returned by `gen_time_range()`) in addition to `pd.DatetimeIndex`\n- `fit()` now accepts a `datetime64` array or pandas `Timestamp` Series for\n  `time_fit`; conversion via `to_days()` is automatic\n- `prepare_part_data()` no longer adds a `Timedays` column to the returned\n  DataFrame; time handling is done internally via `to_days()`\n- `prepare_part_data()` returns an independent copy of the participant's data;\n  mutations to the returned DataFrame do not affect the original; redundant\n  `Date` and `Time` columns are dropped (both are combined in `Timestamp`)\n\n### [v0.2.0](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.2.0) - Simplified API\n- New module `results.py` with classes: `AnalysisResult` (abstract\n  base), `AnalysisInfo`, `AmplitudeResult`, `MidpointResult`, `AreaCogResult`,\n  `FitResult` and `ResultsCollector` for result management\n- `FitResult` wraps `scipy.optimize.OptimizeResult` in its `result` field;\n  `fit()` now returns `FitResult`\n- `FitResult` can be passed directly to waveform functions and `compute_wave`\n- `amplitude()`, `midpoint()` and `area_cog()` now return their respective\n  result classes instead of tuples/floats\n- `to_dict()` on all result classes: timing fields returned as `HH:MM`\n  strings, other fields as native types\n- `AnalysisInfo.r2` defaults to `NaN` for convenience in DLMO workflows\n- New `string_to_phase()` utility function in `utils.py` (inverse of\n  `phase_to_string`)\n- `day_profile()` accepts separate times and values parameters\n- `PARAM_NAMES` renamed to `BUILTIN_PARAM_NAMES`\n- Example scripts simplified via `ResultsCollector` and result classes\n- Unit tests for all new classes and methods\n\n### [v0.1.3](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.1.3)\n- Improved documentation\n- Developer installation option\n\n### [v0.1.2](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.1.2)\n- Improved documentation\n\n### [v0.1.1](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.1.1) - First PyPI release\n- Enhanced function `fit()` to support custom waveform functions with\n  user-defined initial parameters and bounds\n- Changed named parameter order in `fit()`: `cost_f` and `cost_p` are\n  now the last two parameters\n- Fixed returned type hints in `func_defaults()`\n- Additional unit tests for new functionality\n- Improved README\n- Package registered in Python Package Index PyPI\n\n### [v0.1.0](https://github.com/vitaliy-ch25/melafit/releases/tag/v0.1.0) - First public release\n- Dictionary support for waveform function parameters throughout the\n  package: all functions accept both `dict` and `np.ndarray` for\n  parameter input\n- Named parameter constants: `BCF_PARAM_NAMES`, `SBCF_PARAM_NAMES`,\n  `BBCF_PARAM_NAMES`, `BSBCF_PARAM_NAMES` and `PARAM_NAMES` lookup\n- New utility functions `params_to_array()` and `array_to_params()` for\n  conversion between array and named dictionary representations\n- `fit()` now returns named parameter dictionary as `res.p` in addition\n  to the standard scipy `res.x` array\n- `fit()` now accepts `cost_p` dictionary for passing parameters to the\n  cost function (e.g. `{\"eps\": 1e-6}`)\n- New utility function `params_to_string()` for human-readable parameter output\n- Fixed `area_cog()`: baseline subtraction and bin size normalization\n- Unit tests for all public functions in `fitting`, `markers` and `utils`\n\n### Initial revisions (v0.0.1 – v0.0.9)\n- Full implementation of melatonin profile analysis as described in\n  [Gabel et al. (2017)](https://doi.org/10.1038/s41598-017-07060-8)\n- Waveform functions: `bcf`, `sbcf`, `bbcf`, `bsbcf`\n- Markers: `amplitude`, `midpoint`, `DLMOn`, `DLMOff`, `area`, `cog`\n- Utilities: `read_data`, `prepare_part_data`, `compute_wave`,\n  `day_profile`, `abs_threshold`, `time_to_phase`, `phase_to_string`,\n  `phase_diff`\n- Example scripts: `example_dlmo.py` (DLMO from partial data) and\n  `example_full_profile.py` (full profile analysis)\n- MIT license, packaging metadata and README\n\u003c/details\u003e\n\n## License\n\nThis project is licensed under the MIT License. See the \n[LICENSE](https://github.com/vitaliy-ch25/melafit/blob/main/LICENSE) file for \ndetails.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitaliy-ch25%2Fmelafit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitaliy-ch25%2Fmelafit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitaliy-ch25%2Fmelafit/lists"}