From 9b95e471897a92dd6a458aa79c90d38123be61b2 Mon Sep 17 00:00:00 2001 From: Derek Tucker Date: Tue, 3 Sep 2024 15:56:30 -0600 Subject: [PATCH] fix code cov (#64) * Update python-package.yml * rename files * one more rename * change directory * restore full test invok * wrong command * update version pinned * fix for 3.12 --- .github/workflows/python-package.yml | 4 +-- debug/{test_oc_geod.py => oc_geod.py} | 0 debug/{test_oc_karcher.py => oc_karcher.py} | 0 debug/{test_oc_logit.py => oc_logit.py} | 0 debug/{test_ps_geod.py => ps_geod.py} | 0 debug/test_oc_mlogit.py | 38 --------------------- pyproject.toml | 2 +- 7 files changed, 3 insertions(+), 41 deletions(-) rename debug/{test_oc_geod.py => oc_geod.py} (100%) rename debug/{test_oc_karcher.py => oc_karcher.py} (100%) rename debug/{test_oc_logit.py => oc_logit.py} (100%) rename debug/{test_ps_geod.py => ps_geod.py} (100%) delete mode 100644 debug/test_oc_mlogit.py diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 91d326d2..b1cbffe0 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -50,8 +50,8 @@ jobs: - if: runner.os == 'Linux' name: Test with pytest run: | - pip install . - pytest test/ --cov + pip install -e . + pytest --cov - if: runner.os == 'Windows' name: Build run: | diff --git a/debug/test_oc_geod.py b/debug/oc_geod.py similarity index 100% rename from debug/test_oc_geod.py rename to debug/oc_geod.py diff --git a/debug/test_oc_karcher.py b/debug/oc_karcher.py similarity index 100% rename from debug/test_oc_karcher.py rename to debug/oc_karcher.py diff --git a/debug/test_oc_logit.py b/debug/oc_logit.py similarity index 100% rename from debug/test_oc_logit.py rename to debug/oc_logit.py diff --git a/debug/test_ps_geod.py b/debug/ps_geod.py similarity index 100% rename from debug/test_ps_geod.py rename to debug/ps_geod.py diff --git a/debug/test_oc_mlogit.py b/debug/test_oc_mlogit.py deleted file mode 100644 index 5871bf86..00000000 --- a/debug/test_oc_mlogit.py +++ /dev/null @@ -1,38 +0,0 @@ -import os, sys, inspect -# realpath() with make your script run, even if you symlink it :) -cmd_folder = os.path.realpath(os.path.abspath(os.path.split(inspect.getfile( inspect.currentframe() ))[0]) + "/../fdasrsf") -if cmd_folder not in sys.path: - sys.path.insert(0, cmd_folder) -import h5py -import numpy as np -import curve_functions as cf -import curve_regression as cr -fun = h5py.File('/Users/jdtucker/Documents/Research/SRVF_FDA/Data/Full20shapedata.h5') -C = fun['beta'][:] -C = C.T - -a, b, c = C.shape -beta = np.zeros((a, b, 80)) -for ii in range(0, 20): - beta_tmp = np.zeros((a, b+1)) - beta_tmp[:, 0:b] = C[:, :, ii] - beta_tmp[:, b] = C[:, 0, ii] - beta[:, :, ii] = cf.resamplecurve(beta_tmp, b) - beta_tmp[:, 0:b] = C[:, :, ii+20] - beta_tmp[:, b] = C[:, 0, ii+20] - beta[:, :, ii+20] = cf.resamplecurve(beta_tmp, b) - beta_tmp[:, 0:b] = C[:, :, ii+40] - beta_tmp[:, b] = C[:, 0, ii+40] - beta[:, :, ii+40] = cf.resamplecurve(beta_tmp, b) - beta_tmp[:, 0:b] = C[:, :, ii+60] - beta_tmp[:, b] = C[:, 0, ii+60] - beta[:, :, ii+60] = cf.resamplecurve(beta_tmp, b) - -y = np.ones(80, dtype=int) -y[20:40] = 2 -y[40:60] = 3 -y[60:80] = 4 - -model = cr.oc_elastic_mlogistic(beta, y, df=60, T=200, max_itr=40, - deltaO=.08, deltag=.05) -out = cr.oc_elastic_prediction(beta, model, y=y) diff --git a/pyproject.toml b/pyproject.toml index 96aff7d9..d29fc004 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,7 +82,7 @@ build-backend = "setuptools.build_meta" [tool.pytest.ini_options] minversion = "6.0" -addopts = "-ra -q" +addopts = "--import-mode=importlib" testpaths = [ "tests", ]