Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Remove some warnings #100

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions neurots/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import json
from pathlib import Path

try:
import importlib_resources as resources
except ImportError:
from importlib import resources

import jsonschema
import pkg_resources

SCHEMA_PATH = pkg_resources.resource_filename("neurots", "schemas")
SCHEMA_PATH = resources.files("neurots") / "schemas"

with Path(SCHEMA_PATH, "parameters.json").open(encoding="utf-8") as f:
with (SCHEMA_PATH / "parameters.json").open(encoding="utf-8") as f:
PARAMS_SCHEMA = json.load(f)

with Path(SCHEMA_PATH, "distributions.json").open(encoding="utf-8") as f:
with (SCHEMA_PATH / "distributions.json").open(encoding="utf-8") as f:
DISTRIBS_SCHEMA = json.load(f)


Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ force_single_line = true
testpaths = [
"tests",
]
filterwarnings = [
"ignore:The --rsyncdir command.*:DeprecationWarning:xdist",
"ignore:Pyarrow will become a required dependency of pandas.*:DeprecationWarning:diameter-synthesis",
]
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@

reqs = [
"jsonschema>=3.0.1",
"importlib-resources>=5; python_version < '3.9'",
"matplotlib>=3.4",
"morphio>=3.3.6,<4.0",
"neurom>=3.0,<4.0",
"numpy>=1.22.0",
"packaging>=20",
"scipy>=1.6",
"tmd>=2.3.0",
"diameter-synthesis>=0.5.4",
Expand Down
7 changes: 5 additions & 2 deletions tests/test_extract_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
from neurom import load_morphologies
from numpy.testing import assert_array_almost_equal
from numpy.testing import assert_equal
from pkg_resources import parse_version
from packaging import version

from neurots import NeuroTSError
from neurots import extract_input
from neurots import validator

_OLD_NUMPY = parse_version(np.__version__) < parse_version("1.21")
_OLD_NUMPY = version.parse(np.__version__) < version.parse("1.21")

_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "test_data")
POP_PATH = os.path.join(_PATH, "bio/")
Expand Down Expand Up @@ -883,3 +883,6 @@ def test_transform_distr():
ss = neurom.stats.fit(data, distribution="expon")
res = extract_input.from_neurom.transform_distr(ss)
assert_equal(res, {"expon": {"loc": 0.005522117123602399, "lambda": 2.1521175837421254}})

ss = neurom.stats.fit(data, distribution="exponnorm")
assert extract_input.from_neurom.transform_distr(ss) is None