Skip to content

Commit

Permalink
major refactoring and increased test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
j-brady committed May 26, 2024
1 parent 3ca2acd commit 5c33de2
Show file tree
Hide file tree
Showing 21 changed files with 4,543 additions and 835 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ site/
# Tests
test/test_protein_L/tmp/
## pytest
.pytest_cache
.pytest_cache
.coverage
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.PHONY: coverage

coverage:
coverage run -m pytest test/test_core.py test/test_main.py test/test_fit.py test/test_cli.py
#coverage run -m pytest test/test_core.py test/test_main.py test/test_fit.py test/test_cli.py
coverage run -m pytest test/test_fitting.py test/test_lineshapes.py test/test_io.py test/test_utils.py test/test_main.py test/test_cli.py

coverage-html:
coverage html
Expand Down
2 changes: 1 addition & 1 deletion peakipy/cli/check_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def create_plotly_pane(cluster, plane):
data_path=data.data_path,
clusters=[cluster],
plane=[plane],
config_path=data.config_path,
# config_path=data.config_path,
plotly=True,
)

Expand Down
3 changes: 2 additions & 1 deletion peakipy/cli/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
from bokeh.plotting.contour import contour_data
from bokeh.palettes import PuBuGn9, Category20, Viridis256, RdGy11, Reds256, YlOrRd9

from peakipy.core import LoadData, update_args_with_values_from_config_file, StrucEl
from peakipy.io import LoadData, StrucEl
from peakipy.utils import update_args_with_values_from_config_file

log_style = "overflow:scroll;"
log_div = """<div style=%s>%s</div>"""
Expand Down
5 changes: 4 additions & 1 deletion peakipy/cli/edit_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,12 @@ def fit_peaks_button_click(event):
button.on_click(fit_peaks_button_click)

def update_source_selected_indices(event):
# print(event)
# print(bs.tablulator_widget.selection)
# hack to make current selection however, only allows one selection
# at a time
bs.tablulator_widget._update_selection([event.value])
bs.source.selected.indices = bs.tablulator_widget.selection
# print(bs.tablulator_widget.selection)

bs.tablulator_widget.on_click(update_source_selected_indices)
bs.tablulator_widget.on_edit(update_peakipy_data_on_edit_of_table)
Expand Down
8 changes: 5 additions & 3 deletions peakipy/cli/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
from lmfit import Model, Parameter, Parameters
from lmfit.model import ModelResult

from peakipy.core import (
fix_params,
from peakipy.lineshapes import (
Lineshape,
pvoigt2d,
voigt2d,
pv_pv,
get_lineshape_function,
)
from peakipy.fitting import (
fix_params,
to_prefix,
get_limits_for_axis_in_points,
get_lineshape_function,
deal_with_peaks_on_edge_of_spectrum,
select_planes_above_threshold_from_masked_data,
select_reference_planes_using_indices,
Expand Down
Loading

0 comments on commit 5c33de2

Please sign in to comment.