diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b4a696c..ad39bc5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,10 @@ Change Log This document records the main changes to the sdss_access code. +2.0.5 (2022-11-30) +------------------ +- Bug fix for downloading IPL-1 products with sdss_access + 2.0.4 (2022-11-30) ------------------ - Fixing broken tests with MWM paths diff --git a/docs/sphinx/path_defs.rst b/docs/sphinx/path_defs.rst index 829200e..3e4ea15 100644 --- a/docs/sphinx/path_defs.rst +++ b/docs/sphinx/path_defs.rst @@ -17,6 +17,15 @@ SDSSWORK :prog: sdsswork :templates: +.. _dr18: + +DR18 +---- + +.. datamodel:: sdss_access.path.path:Path + :prog: DR18 + :templates: + .. _dr17: DR17 @@ -195,4 +204,13 @@ SDSS-V .. datamodel:: sdss_access.path.path:Path :prog: sdss5 + :templates: + +.. _ipl1: + +IPL1 +---- + +.. datamodel:: sdss_access.path.path:Path + :prog: IPL1 :templates: \ No newline at end of file diff --git a/docs/sphinx/path_evolution.rst b/docs/sphinx/path_evolution.rst index ad43602..27628ad 100644 --- a/docs/sphinx/path_evolution.rst +++ b/docs/sphinx/path_evolution.rst @@ -10,6 +10,10 @@ releases (DRs) and internal SDSS data releases, e.g. MaNGA Product Launches (MPL Public Data Releases -------------------- +.. changelog:: sdss_access.path.changelog:compute_changelog + :prog: changes + :drs: dr18, dr17 + .. changelog:: sdss_access.path.changelog:compute_changelog :prog: changes :drs: dr17, dr16 @@ -49,6 +53,14 @@ Public Data Releases Internal Data Releases ---------------------- +Internal Product Launches (IPLs) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. changelog:: sdss_access.path.changelog:compute_changelog + :prog: changes + :drs: ipl1, ipl1 + + MaNGA Product Launches (MPLs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/sphinx/paths.rst b/docs/sphinx/paths.rst index 87d30fd..9a0e9f9 100644 --- a/docs/sphinx/paths.rst +++ b/docs/sphinx/paths.rst @@ -15,7 +15,8 @@ Current Working Paths Public Data Release Paths -* :ref:`DR17 ` - paths defined for public data release 17 +* :ref:`DR18 ` - paths defined for public data release 18 +* :ref:`DR17 ` * :ref:`DR16 ` * :ref:`DR15 ` * :ref:`DR14 ` @@ -28,8 +29,10 @@ Public Data Release Paths Internal SDSS Release Paths +* :ref:`IPL-1 ` - Internal Product Launch 1 + * :ref:`MPL-11` - MaNGA Product Launch 11 -* :ref:`MPL-10` +* :ref:`MPL-10` * :ref:`MPL-9` * :ref:`MPL-8` * :ref:`MPL-7` diff --git a/python/sdss_access/path/path.py b/python/sdss_access/path/path.py index 449202f..4bc942a 100644 --- a/python/sdss_access/path/path.py +++ b/python/sdss_access/path/path.py @@ -100,6 +100,7 @@ class BasePath(object): _netloc = {"dtn": "dtn.sdss.org", "sdss": "data.sdss.org", "sdss5": "data.sdss5.org", "mirror": "data.mirror.sdss.org", "svn": "svn.sdss.org"} + _s5cfgs = ['sdss5', 'ipl1'] # list of collab-only SDSS-V releases/configs def __init__(self, release=None, public=False, mirror=False, verbose=False, force_modules=None, preserve_envvars=None): @@ -832,7 +833,7 @@ def get_netloc(self, netloc=None, sdss=None, sdss5=None, dtn=None, svn=None, mir elif svn: return '{0}{1}'.format(self._netloc["svn"], "/public" if self.public else '') else: - return self._netloc["sdss5"] if self.release == "sdss5" else self._netloc["sdss"] + return self._netloc["sdss5"] if self.release in self._s5cfgs else self._netloc["sdss"] def set_netloc(self, netloc=None, sdss=None, sdss5=None, dtn=None, svn=None, mirror=None): ''' Set a url domain location @@ -878,7 +879,7 @@ def get_remote_base(self, scheme="https", svn=None): if self.public or scheme == "https": remote_base = "{scheme}://{netloc}".format(scheme=scheme, netloc=netloc) else: - user = "sdss5" if self.release == "sdss5" else "sdss" + user = "sdss5" if self.release in self._s5cfgs else "sdss" remote_base = "{scheme}://{user}@{netloc}".format(scheme=scheme, user=user, netloc=netloc) return remote_base diff --git a/python/sdss_access/sync/baseaccess.py b/python/sdss_access/sync/baseaccess.py index 8ffbd5f..c4ea8a4 100644 --- a/python/sdss_access/sync/baseaccess.py +++ b/python/sdss_access/sync/baseaccess.py @@ -35,7 +35,7 @@ def remote(self, username=None, password=None, inquire=None): use_dtn = self.remote_scheme == 'rsync' # simplifies things to have a single sdss (or sdss5) machine in # .netrc for SDSS-IV (or SDSS-V, respectively). - sdss5 = ( self.release == 'sdss5' ) + sdss5 = ( self.release in self._s5cfgs ) self.set_netloc(sdss=not sdss5, sdss5=sdss5) self.set_auth(username=username, password=password, inquire=inquire) if use_dtn: diff --git a/tests/sync/test_access.py b/tests/sync/test_access.py index dd18479..5045a4e 100644 --- a/tests/sync/test_access.py +++ b/tests/sync/test_access.py @@ -37,3 +37,28 @@ def test_access(monkey_posix): assert Access.access_mode == mode assert issubclass(Access, core) +@pytest.mark.parametrize('cfg, exp', + [('sdss5', 'data.sdss5.org'), + ('ipl1', 'data.sdss5.org'), + ('dr17', 'data.sdss.org'), + ('sdsswork', 'data.sdss.org'), + ('mpl9', 'data.sdss.org')], + ids=['sdss5', 'ipl1', 'dr17', 'sdsswork', 'mpl9']) +def test_netloc(cfg, exp): + a = RsyncAccess(release=cfg) + assert a.netloc == exp + assert a.remote_base == f'https://{exp}' + +@pytest.mark.parametrize('cfg, exp', + [('sdss5', 'sdss5'), + ('ipl1', 'sdss5'), + ('dr17', ''), + ('sdsswork', 'sdss'), + ('mpl9', 'sdss')], + ids=['sdss5', 'ipl1', 'dr17', 'sdsswork', 'mpl9']) +def test_remote_base(cfg, exp): + a = RsyncAccess(release=cfg) + a.remote() + assert a.netloc == 'dtn.sdss.org' + exp = exp if cfg == 'dr17' else f'{exp}@' + assert a.remote_base == f'rsync://{exp}dtn.sdss.org' \ No newline at end of file