Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyPLNmodels
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BATARDIERE Bastien
pyPLNmodels
Commits
5512fa99
Commit
5512fa99
authored
1 year ago
by
Bastien Batardière
Browse files
Options
Downloads
Patches
Plain Diff
remove useless tests.
parent
6eaabd2a
No related branches found
No related tags found
1 merge request
!15
merged dmatrix branch that uses dmatrix to initialize each model.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_args.py
+0
-66
0 additions, 66 deletions
tests/test_args.py
tests/test_common.py
+2
-0
2 additions, 0 deletions
tests/test_common.py
tests/test_pln_full.py
+0
-5
0 additions, 5 deletions
tests/test_pln_full.py
with
2 additions
and
71 deletions
tests/test_args.py
deleted
100644 → 0
+
0
−
66
View file @
6eaabd2a
import
os
from
pyPLNmodels.models
import
PLN
,
PLNPCA
,
_PLNPCA
from
pyPLNmodels
import
get_simulated_count_data
,
get_real_count_data
import
pytest
from
pytest_lazyfixture
import
lazy_fixture
as
lf
import
pandas
as
pd
import
numpy
as
np
(
counts_sim
,
covariates_sim
,
offsets_sim
,
)
=
get_simulated_count_data
(
nb_cov
=
2
)
couts_real
=
get_real_count_data
(
n_samples
=
298
,
dim
=
101
)
RANKS
=
[
2
,
8
]
@pytest.fixture
def
instance_plnpca
():
plnpca
=
PLNPCA
(
ranks
=
RANKS
)
return
plnpca
@pytest.fixture
def
instance__plnpca
():
model
=
_PLNPCA
(
rank
=
RANKS
[
0
])
return
model
@pytest.fixture
def
instance_pln_full
():
return
PLN
()
all_instances
=
[
lf
(
"
instance_plnpca
"
),
lf
(
"
instance__plnpca
"
),
lf
(
"
instance_pln_full
"
)]
@pytest.mark.parametrize
(
"
instance
"
,
all_instances
)
def
test_pandas_init
(
instance
):
instance
.
fit
(
pd
.
DataFrame
(
counts_sim
.
numpy
()),
pd
.
DataFrame
(
covariates_sim
.
numpy
()),
pd
.
DataFrame
(
offsets_sim
.
numpy
()),
)
@pytest.mark.parametrize
(
"
instance
"
,
all_instances
)
def
test_numpy_init
(
instance
):
instance
.
fit
(
counts_sim
.
numpy
(),
covariates_sim
.
numpy
(),
offsets_sim
.
numpy
())
@pytest.mark.parametrize
(
"
sim_pln
"
,
simulated_any_pln
)
def
test_only_counts
(
sim_pln
):
sim_pln
.
fit
()
@pytest.mark.parametrize
(
"
sim_pln
"
,
simulated_any_pln
)
def
test_only_counts_and_offsets
(
sim_pln
):
sim_pln
.
fit
(
counts
=
counts_sim
,
offsets
=
offsets_sim
)
@pytest.mark.parametrize
(
"
sim_pln
"
,
simulated_any_pln
)
def
test_only_Y_and_cov
(
sim_pln
):
sim_pln
.
fit
(
counts
=
counts_sim
,
covariates
=
covariates_sim
)
This diff is collapsed.
Click to expand it.
tests/test_common.py
+
2
−
0
View file @
5512fa99
...
...
@@ -119,6 +119,7 @@ def test_fail_count_setter(pln):
def
test_setter_with_numpy
(
pln
):
np_counts
=
pln
.
counts
.
numpy
()
pln
.
counts
=
np_counts
pln
.
fit
()
@pytest.mark.parametrize
(
"
pln
"
,
dict_fixtures
[
"
all_pln
"
])
...
...
@@ -126,6 +127,7 @@ def test_setter_with_numpy(pln):
def
test_setter_with_pandas
(
pln
):
pd_counts
=
pd
.
DataFrame
(
pln
.
counts
.
numpy
())
pln
.
counts
=
pd_counts
pln
.
fit
()
@pytest.mark.parametrize
(
"
instance
"
,
dict_fixtures
[
"
instances
"
])
...
...
This diff is collapsed.
Click to expand it.
tests/test_pln_full.py
+
0
−
5
View file @
5512fa99
...
...
@@ -2,8 +2,3 @@ import torch
from
import_fixtures_and_data
import
get_dict_fixtures
from
pyPLNmodels
import
PLN
df
=
get_dict_fixtures
(
PLN
)
for
key
,
fixture
in
df
.
items
():
print
(
len
(
fixture
))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment