Skip to content

Commit

Permalink
DEPR: Remove mention to DS2 in Unistra (keep only the mounting points…
Browse files Browse the repository at this point in the history
… for legacy purposes)
  • Loading branch information
remi-braun committed Feb 17, 2025
1 parent afce059 commit ddea5e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- FIX: Add more tolerances in `geometry.simplify_footprint` to allow further simplification, and a warning in case of failure
- FIX: Force 2D geometries in `rasters.crop` as `odc.geo.xr.crop` don't work with 3D geometries
- OPTIM: Only write rasters on disk with `windowed=True` in case of big rasters _(w/*h > 20,000*20,000 pixels)_
- DEPR: Remove mention to DS2 in Unistra (keep only the mounting points for legacy purposes)
- CI: Refactor `.gitlab-ci.yml` file with new GitLab templates

## 1.45.0 (2025-01-27)
Expand Down
21 changes: 5 additions & 16 deletions sertit/unistra.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,10 @@ def get_geodatastore() -> AnyPathType:
s3.define_s3_client()
return AnyPath("s3://sertit-geodatastore")
else:
# on the DS2
db_dir = AnyPath(r"//ds2/database02/BASES_DE_DONNEES")

if not db_dir.is_dir():
try:
db_dir = AnyPath(get_db2_path(), "BASES_DE_DONNEES")
except NotADirectoryError:
db_dir = AnyPath("/home", "ds2_db2", "BASES_DE_DONNEES")
try:
db_dir = AnyPath(get_db2_path(), "BASES_DE_DONNEES")
except NotADirectoryError:
db_dir = AnyPath("/home", "ds2_db2", "BASES_DE_DONNEES")

if not db_dir.is_dir():
raise NotADirectoryError("Impossible to open database directory !")
Expand Down Expand Up @@ -197,15 +193,11 @@ def _get_db_path(db_nb=2) -> str:
Returns DSx database0x path
- :code:`/mnt/ds2_dbx` when mounted (docker...)
- :code:`//ds2/database0x` on windows
"""
db_path = f"{get_mnt_path()}/ds2_db{db_nb}"

if not os.path.isdir(db_path):
db_path = rf"\\DS2\database0{db_nb}"

if not os.path.isdir(db_path):
raise NotADirectoryError(f"Impossible to open ds2/database0{db_nb}!")
raise NotADirectoryError(f"Impossible to open {db_path}!")
return db_path


Expand All @@ -214,7 +206,6 @@ def get_db2_path() -> str:
Returns DS2 database02 path
- :code:`/mnt/ds2_db2` when mounted (docker...)
- :code:`//ds2/database02` on windows
Returns:
str: Mounted directory
Expand All @@ -231,7 +222,6 @@ def get_db3_path() -> str:
Returns DS2 database03 path
- :code:`/mnt/ds2_db3` when mounted (docker...)
- :code:`//ds2/database03` on windows
Returns:
str: Mounted directory
Expand All @@ -248,7 +238,6 @@ def get_db4_path() -> str:
Returns DS2 database04 path
- :code:`/mnt/ds2_db4` when mounted (docker...)
- :code:`//ds2/database04` on windows
Returns:
str: Mounted directory
Expand Down

0 comments on commit ddea5e2

Please sign in to comment.