Commit d4cadaf6 authored by Paulo Medeiros's avatar Paulo Medeiros
Browse files

Update deps. Adap code accordingly.

parent 8029cbbe
Pipeline #10658 failed with stages
in 15 minutes and 57 seconds
......@@ -18,3 +18,4 @@ poetry.lock
cluster_obs_single_dtg.html
select_stations.html
dist/
.idea/
default_language_version:
python: python3.8
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.10b0
rev: 22.1.0
hooks:
- id: black
language_version: python3.8
- repo: local
hooks:
- id: pylint
......
......@@ -7,12 +7,10 @@ import time
from datetime import datetime
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_table
import numpy as np
import pandas as pd
import redis
from dash import dash_table, dcc, html
from dash.dependencies import Input, Output, State
from flask_caching import Cache
from server import server
......
......@@ -5,11 +5,10 @@ import os
from datetime import datetime as dt
import dash
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import pandas as pd
import plotly.graph_objects as go
from dash import dcc, html
from dash.dependencies import Input, Output, State
from server import server
......
......@@ -11,7 +11,7 @@ from numba import njit, prange
logger = logging.getLogger(__name__)
class HsmDiagNotStoredInCompactForm(Exception):
class HsmDiagNotStoredInCompactFormError(Exception):
"""Exception to inform that HSM matrix is not in compact form."""
def __init__(
......@@ -190,7 +190,7 @@ def _to_compact(dense, dtype):
raise ValueError("'dense' is not a square matrix")
n = dense.shape[0]
n_indep = (n ** 2 - n) // 2
n_indep = (n**2 - n) // 2
compact = np.zeros(n_indep, dtype=dtype)
for idata in prange(len(compact)): # pylint: disable=not-an-iterable
i, j = _data_index_to_matrix_index(n, idata, check_bounds=False)
......@@ -218,7 +218,7 @@ def _get_hsm_subspace_from_compact(compact, indices):
n_indep = len(compact)
n = int(np.rint(0.5 * (1.0 + np.sqrt(1.0 + 8.0 * n_indep))))
new_n = len(indices)
new_n_indep = (new_n ** 2 - new_n) // 2
new_n_indep = (new_n**2 - new_n) // 2
new_compact = np.zeros(new_n_indep, dtype=compact.dtype)
idata_new = 0
......@@ -487,7 +487,7 @@ class HollowSymmetricMatrix(np.lib.mixins.NDArrayOperatorsMixin):
@property
def n_indep_els(self):
"""Return the #independent (non-redundant off-diagonal) elements."""
return (self.order ** 2 - self.order) // 2
return (self.order**2 - self.order) // 2
@property
def shape(self):
......@@ -600,7 +600,7 @@ class HollowSymmetricMatrix(np.lib.mixins.NDArrayOperatorsMixin):
def index_dense_to_compact(self, i, j):
"""Return integer I such that self.data[I] == self[i, j]."""
if i == j:
raise HsmDiagNotStoredInCompactForm
raise HsmDiagNotStoredInCompactFormError
return _matrix_index_to_data_index(self.order, i, j)
def index_compact_to_dense(self, data_i):
......@@ -626,7 +626,7 @@ class HollowSymmetricMatrix(np.lib.mixins.NDArrayOperatorsMixin):
try:
i_data = self.index_dense_to_compact(*ij_tuple)
rtn = self.compact_form()[i_data]
except HsmDiagNotStoredInCompactForm:
except HsmDiagNotStoredInCompactFormError:
rtn = 0.0
elif all(isinstance(_, slice) for _ in ij_tuple):
logger.debug("%s: Get row and column slices", type(self).__name__)
......@@ -720,7 +720,7 @@ class HollowSymmetricMatrix(np.lib.mixins.NDArrayOperatorsMixin):
self._data[ij_tuple[::-1]] = value
else:
self._data[i_data] = value
except HsmDiagNotStoredInCompactForm:
except HsmDiagNotStoredInCompactFormError:
# Make sure the matrix remains hollow
logger.warning(
"Cannot set %s diagnonal elements. Doing nothing.",
......
[tool.poetry]
name = "netatmoqc"
version = "0.4.0.beta-1"
version = "0.4.0.beta-2"
description = "Use machine learning clustering methods to perform quality control over NetAtmo data"
authors = [
"Paulo V. C. Medeiros <paulo.medeiros@smhi.se>"
......@@ -15,65 +15,61 @@
[build-system]
build-backend = "poetry.core.masonry.api"
requires = [
"poetry-core >= 1.0.0",
"numpy >= 1.19.0",
]
requires = "poetry-core >= 1.0.0"
[tool.poetry.dependencies]
python = "^3.8.8,<3.10"
attrs = "^21.2.0"
dash = "^1.13.4"
dash-daq = "^0.5.0"
dotmap = "^1.3.17"
flask-caching = "^1.9.0"
hdbscan = "^0.8.26"
humanize = "^3.7.0"
importlib-metadata = "^4.5.0"
joblib = "^1.0.0"
llvmlite = "0.36.0"
mpi4py = {version="^3.0.3", optional=true}
attrs = "^21.4.0"
dash = "^2.1.0"
dotmap = "^1.3.26"
flask-caching = "^1.10.1"
hdbscan = "^0.8.28"
humanize = "^3.14.0"
importlib-metadata = "^4.10.1"
joblib = "^1.1.0"
mpi4py = {version = "^3.1.3", optional=true}
numba = "^0.53.1"
numpy = "^1.19.0"
pandas = "^1.2.4"
plotly = "^4.8.2"
psutil = "^5.7.0"
pyproj = "^3.1.0"
pytz = "^2021.1"
redis = "^3.5.3"
scikit-learn = "^0.24.2"
numpy = "^1.22.2"
pandas = "^1.4.0"
plotly = "^5.6.0"
psutil = "^5.9.0"
pyproj = "^3.3.0"
pytz = "^2021.3"
redis = "^4.1.3"
scikit-learn = "^1.0.2"
# tbb>=2019.5 is needed by numba when using parallel=True in jit
# This version, however, is not available for sys_platform==darwin (on 2020-08-25)
tbb = { version = "^2021.2.0", markers = "sys_platform != 'darwin'" }
toml = "^0.10.1"
tbb = { version = "^2021.5.1", markers = "sys_platform != 'darwin'" }
toml = "^0.10.2"
[tool.poetry.extras]
mpi = ["mpi4py"]
[tool.poetry.dev-dependencies]
black = "^21.5b2"
black = "^22.1.0"
flake8 = "^3.9.2"
flakehell = "^0.9.0"
isort = "^5.6.4"
pre-commit = "^2.6.0"
isort = "^5.10.1"
poetryup = "^0.5.4"
pre-commit = "^2.17.0"
pyment = "0.3.3"
pylint = "^2.8.3"
pytest = "^6.0.0"
pytest-timeout = "^1.4.1"
tox = "^3.19.0"
pylint = "^2.12.2"
pytest = "^7.0.0"
pytest-timeout = "^2.1.0"
tox = "^3.24.5"
# flake8 plugins
darglint = "^1.5.5"
darglint = "^1.8.1"
flake8-bandit = "^2.1.2"
flake8-bugbear = "^21.4.3"
flake8-bugbear = "^22.1.11"
flake8-builtins = "^1.5.3"
flake8-comprehensions = "^3.2.3"
flake8-docstrings = "^1.5.0"
flake8-eradicate = "^1.0.0"
flake8-comprehensions = "^3.8.0"
flake8-docstrings = "^1.6.0"
flake8-eradicate = "^1.2.0"
flake8-logging-format = "^0.6.0"
flake8-mutable = "^1.2.0"
flake8-pytest-style = "^1.3.0"
flake8-pytest-style = "^1.6.0"
mccabe = "^0.6.1"
pep8-naming = "^0.11.1"
pep8-naming = "^0.12.1"
[tool.pytest.ini_options]
testpaths = "tests"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment