Skip to content

Commit

Permalink
Merge pull request #123 from pastas/deprecate_connectors
Browse files Browse the repository at this point in the history
Deprecate PystoreConnector and ArcticConnector
  • Loading branch information
dbrakenhoff authored Jun 26, 2024
2 parents 0eea302 + 535f985 commit d723f66
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 95 deletions.
12 changes: 12 additions & 0 deletions pastastore/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def __init__(self, name: str, connstr: str):
connstr : str
connection string (e.g. 'mongodb://localhost:27017/')
"""
warnings.warn(
"ArcticConnector is deprecated. Please use a different "
"connector, e.g. `pst.ArcticDBConnector`.",
DeprecationWarning,
stacklevel=1,
)
try:
import arctic
except ModuleNotFoundError as e:
Expand Down Expand Up @@ -392,6 +398,12 @@ def __init__(self, name: str, path: str):
path : str
path to the pystore directory
"""
warnings.warn(
"PystoreConnector is deprecated. Please use a different "
"connector, e.g. `pst.PasConnector`.",
DeprecationWarning,
stacklevel=1,
)
try:
import pystore
except ModuleNotFoundError as e:
Expand Down
11 changes: 2 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,9 @@ test = [
"pytest-dependency",
"pytest-benchmark",
"codacy-coverage",
"lxml", # temporary fix: for hydropandas 0.8.0
"lxml",
]
pystore = ["fsspec>=0.3.3", "python-snappy", "dask[dataframe]"]
arctic = [
"arctic", # will not work as releases not uploaded to PyPI
]
arcticdb = [
"arcticdb",
"protobuf~=4.0",
] # TODO: temporarily set protobuf to version 4
arcticdb = ["arcticdb"]
docs = [
"pastastore[optional]",
"sphinx_rtd_theme",
Expand Down
86 changes: 0 additions & 86 deletions tests/test_006_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ def test_benchmark_write_series_pas(benchmark):
_ = benchmark(series_write, conn=conn)


@pytest.mark.benchmark(group="write_series")
@requires_pkg("pystore")
def test_benchmark_write_series_pystore(benchmark):
path = "./tests/data/pystore"
conn = pst.PystoreConnector("test", path)
_ = benchmark(series_write, conn=conn)


@pytest.mark.benchmark(group="write_series")
@requires_pkg("arctic")
def test_benchmark_write_series_arctic(benchmark):
connstr = "mongodb://localhost:27017/"
conn = pst.ArcticConnector("test", connstr)
_ = benchmark(series_write, conn=conn)


@pytest.mark.benchmark(group="write_series")
@requires_pkg("arcticdb")
def test_benchmark_write_series_arcticdb(benchmark):
Expand Down Expand Up @@ -73,22 +57,6 @@ def test_benchmark_read_series_pas(benchmark):
_ = benchmark(series_read, conn=conn)


@pytest.mark.benchmark(group="read_series")
@requires_pkg("pystore")
def test_benchmark_read_series_pystore(benchmark):
path = "./tests/data/pystore"
conn = pst.PystoreConnector("test", path)
_ = benchmark(series_read, conn=conn)


@pytest.mark.benchmark(group="read_series")
@requires_pkg("arctic")
def test_benchmark_read_series_arctic(benchmark):
connstr = "mongodb://localhost:27017/"
conn = pst.ArcticConnector("test", connstr)
_ = benchmark(series_read, conn=conn)


@pytest.mark.benchmark(group="read_series")
@requires_pkg("arcticdb")
def test_benchmark_read_series_arcticdb(benchmark):
Expand Down Expand Up @@ -145,24 +113,6 @@ def test_benchmark_write_model_pas(benchmark):
_ = benchmark(write_model, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("pystore")
def test_benchmark_write_model_pystore(benchmark):
path = "./tests/data/pystore"
conn = pst.PystoreConnector("test", path)
ml = build_model(conn)
_ = benchmark(write_model, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("arctic")
def test_benchmark_write_model_arctic(benchmark):
connstr = "mongodb://localhost:27017/"
conn = pst.ArcticConnector("test", connstr)
ml = build_model(conn)
_ = benchmark(write_model, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("arcticdb")
def test_benchmark_write_model_arcticdb(benchmark):
Expand All @@ -187,24 +137,6 @@ def test_benchmark_write_model_nocheckts_pas(benchmark):
_ = benchmark(write_model_nocheckts, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("pystore")
def test_benchmark_write_model_nocheckts_pystore(benchmark):
path = "./tests/data/pystore"
conn = pst.PystoreConnector("test", path)
ml = build_model(conn)
_ = benchmark(write_model_nocheckts, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("arctic")
def test_benchmark_write_model_nocheckts_arctic(benchmark):
connstr = "mongodb://localhost:27017/"
conn = pst.ArcticConnector("test", connstr)
ml = build_model(conn)
_ = benchmark(write_model_nocheckts, conn=conn, ml=ml)


@pytest.mark.benchmark(group="write_model")
@requires_pkg("arcticdb")
def test_benchmark_write_model_nocheckts_arcticdb(benchmark):
Expand Down Expand Up @@ -235,24 +167,6 @@ def test_benchmark_read_model_pas(benchmark):
pst.util.delete_pas_connector(conn)


@pytest.mark.benchmark(group="read_model")
@requires_pkg("pystore")
def test_benchmark_read_model_pystore(benchmark):
path = "./tests/data/pystore"
conn = pst.PystoreConnector("test", path)
_ = benchmark(read_model, conn=conn)
pst.util.delete_pystore_connector(conn=conn)


@pytest.mark.benchmark(group="read_model")
@requires_pkg("arctic")
def test_benchmark_read_model_arctic(benchmark):
connstr = "mongodb://localhost:27017/"
conn = pst.ArcticConnector("test", connstr)
_ = benchmark(read_model, conn=conn)
pst.util.delete_arctic_connector(conn=conn)


@pytest.mark.benchmark(group="read_model")
@requires_pkg("arcticdb")
def test_benchmark_read_model_arcticdb(benchmark):
Expand Down

0 comments on commit d723f66

Please sign in to comment.