Skip to content

Commit

Permalink
Fix fitParams when only some concentrations have replicates (#37)
Browse files Browse the repository at this point in the history
* Fix `fitParams` when only some concentrations have replicates

* lint Jupyter notebooks w `nbqa ruff`
  • Loading branch information
jbloom authored Dec 8, 2023
1 parent 91783d0 commit b9b4f27
Show file tree
Hide file tree
Showing 6 changed files with 180 additions and 171 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
- name: lint code with ruff
run: ruff check .

- name: lint Jupyter notebooks with ruff
run: nbqa ruff .

- name: check code format with black
run: black --check .

Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <https://keepachangelog.com>`_.

0.7.0
-----

Fixed
+++++
- Fixed problem in ``fitParams`` when only some concentrations have replicates.

0.6.0
------

Expand Down
2 changes: 1 addition & 1 deletion neutcurve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

__author__ = "Jesse Bloom"
__email__ = "[email protected]"
__version__ = "0.6.0"
__version__ = "0.7.0"
__url__ = "https://github.com/jbloomlab/neutcurve"

from neutcurve.curvefits import CurveFits # noqa: F401
Expand Down
6 changes: 2 additions & 4 deletions neutcurve/curvefits.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,8 @@ def getCurve(self, *, serum, virus, replicate):
if len(idata) < 1:
raise RuntimeError(f"no data for serum {serum} virus {virus}")

if idata["stderr"].isna().all():
fs_stderr = None
elif idata["stderr"].isna().any():
raise RuntimeError("`stderr` has only some entries NaN\n" + str(idata))
if idata["stderr"].isna().any():
fs_stderr = None # cannot use stderr if any concentrations lack it
else:
fs_stderr = idata["stderr"]

Expand Down
Loading

0 comments on commit b9b4f27

Please sign in to comment.