-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added labels * Added xyz to test data * Added polars-lts-cpu since it supports more cpus * Removed debugger * Addressed 420 and 491 * Removed debugger
- Loading branch information
1 parent
583760a
commit 38e6760
Showing
6 changed files
with
79 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,86 @@ | ||
import pytest | ||
import chainladder as cl | ||
|
||
|
||
def pytest_generate_tests(metafunc): | ||
if "raa" in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
"raa", ["normal_run", "sparse_only_run"], indirect=True) | ||
metafunc.parametrize("raa", ["normal_run", "sparse_only_run"], indirect=True) | ||
if "qtr" in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
"qtr", ["normal_run", "sparse_only_run"], indirect=True) | ||
metafunc.parametrize("qtr", ["normal_run", "sparse_only_run"], indirect=True) | ||
if "clrd" in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
"clrd", ["normal_run", "sparse_only_run"], indirect=True) | ||
metafunc.parametrize("clrd", ["normal_run", "sparse_only_run"], indirect=True) | ||
if "genins" in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
"genins", ["normal_run", "sparse_only_run"], indirect=True) | ||
metafunc.parametrize("genins", ["normal_run", "sparse_only_run"], indirect=True) | ||
if "prism_dense" in metafunc.fixturenames: | ||
metafunc.parametrize( | ||
"prism_dense", ["normal_run", "sparse_only_run"], indirect=True) | ||
"prism_dense", ["normal_run", "sparse_only_run"], indirect=True | ||
) | ||
if "prism" in metafunc.fixturenames: | ||
metafunc.parametrize("prism", ["normal_run"], indirect=True) | ||
if "xyz" in metafunc.fixturenames: | ||
metafunc.parametrize("xyz", ["normal_run", "sparse_only_run"], indirect=True) | ||
|
||
|
||
@pytest.fixture | ||
def raa(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option('ARRAY_BACKEND', 'sparse') | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('raa') | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("raa") | ||
|
||
|
||
@pytest.fixture | ||
def qtr(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option('ARRAY_BACKEND', 'sparse') | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('quarterly') | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("quarterly") | ||
|
||
|
||
@pytest.fixture | ||
def clrd(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option('ARRAY_BACKEND', 'sparse') | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('clrd') | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("clrd") | ||
|
||
|
||
@pytest.fixture | ||
def genins(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option('ARRAY_BACKEND', 'sparse') | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('genins') | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("genins") | ||
|
||
|
||
@pytest.fixture | ||
def prism(request): | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('prism') | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("prism") | ||
|
||
|
||
@pytest.fixture | ||
def prism_dense(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option('ARRAY_BACKEND', 'sparse') | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("prism").sum() | ||
|
||
|
||
@pytest.fixture | ||
def xyz(request): | ||
if request.param == "sparse_only_run": | ||
cl.options.set_option("ARRAY_BACKEND", "sparse") | ||
else: | ||
cl.options.set_option('ARRAY_BACKEND', 'numpy') | ||
return cl.load_sample('prism').sum() | ||
cl.options.set_option("ARRAY_BACKEND", "numpy") | ||
return cl.load_sample("xyz") | ||
|
||
|
||
@pytest.fixture | ||
def atol(): return 1e-4 | ||
def atol(): | ||
return 1e-4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ dependencies: | |
|
||
- pandas | ||
- polars | ||
- polars-lts-cpu | ||
- scikit-learn | ||
- sparse | ||
- numba | ||
|