Skip to content

Commit 0dbaa98

Browse files
authored
Merge pull request #27 from sdss/dtn
Switching server to dtn and adding support for sdss-v product download
2 parents cf47a1f + e7c1a3e commit 0dbaa98

File tree

25 files changed

+385
-142
lines changed

25 files changed

+385
-142
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.1.2dev
2+
current_version = 2.0.0dev
33
commit = True
44
tag = False
55
tag_name = {new_version}
Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: Python application
4+
name: Build and Test
55

6-
on:
7-
push:
8-
branches: [ master, versions ]
9-
pull_request:
10-
branches: [ master ]
6+
on: [push, pull_request]
117

128
jobs:
139
build:
@@ -31,7 +27,20 @@ jobs:
3127
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3228
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3329
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34-
# - name: Test with pytest
35-
# run: |
36-
# pip install pytest
37-
# pytest
30+
- name: Setup SDSS-IV netrc
31+
uses: extractions/netrc@v1
32+
with:
33+
machine: data.sdss.org
34+
username: ${{ secrets.S4_USERNAME }}
35+
password: ${{ secrets.S4_PASSWORD }}
36+
- name: Setup SDSS-V netrc
37+
uses: extractions/netrc@v1
38+
with:
39+
machine: data.sdss5.org
40+
username: ${{ secrets.S5_USERNAME }}
41+
password: ${{ secrets.S5_PASSWORD }}
42+
43+
- name: Test with pytest
44+
run: |
45+
pip install pytest
46+
pytest

.github/workflows/pythonpublish.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
# Sequence of patterns matched against refs/tags
4+
tags:
5+
- "[0-9]+.[0-9]+.[0-9]+" # Exclude pre-releases
6+
7+
name: Create Release
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Create Release
20+
id: create_release
21+
uses: actions/create-release@v1
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
24+
with:
25+
tag_name: ${{ github.ref }}
26+
release_name: sdss_access ${{ github.ref }}
27+
body:
28+
draft: false
29+
prerelease: false
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@v2
33+
with:
34+
python-version: 3.7
35+
36+
- name: Install dependencies
37+
run: |
38+
python -m pip install --upgrade pip
39+
pip install setuptools wheel twine
40+
41+
- name: Build package
42+
run: |
43+
python setup.py sdist bdist_wheel --universal
44+
45+
- name: Publish to PyPI
46+
uses: pypa/gh-action-pypi-publish@master
47+
with:
48+
user: __token__
49+
password: ${{ secrets.pypi_password }}

.github/workflows/sphinxbuild.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ name: Build Sphinx Documentation
44

55
# Controls when the action will run. Triggers the workflow on push or pull request
66
# events but only for the master branch
7-
on:
8-
push:
9-
branches: [ master, versions ]
10-
pull_request:
11-
branches: [ master ]
7+
on: [push, pull_request]
128

139
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1410
jobs:

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@ Change Log
66

77
This document records the main changes to the sdss_access code.
88

9+
2.0.0 (unreleased)
10+
------------------
11+
- Breaking Change: switches `sdss_access` to use new SDSS dtn.sdss.org server
12+
- Feature: adds new "data.sdss5.org" server to support rsync, curl, and http downloads for sdss5 products
13+
- Adding new Sphinx docs for SDSS collaboration authentication
14+
- Updates the public release check to now check todays date against the tree release date, and "DR" in release name.
15+
916
1.1.1 (2020-11-11)
10-
-----------------
17+
------------------
1118
- Feature - Adds new functions for mwm `healpixgrp`, `apginst`, and `apgprefix` to determine other keywords from existing `telescope` kwarg
1219
- Support :issue:`25` - Adds ``preserve_envvars`` option to preserve original os environment variables
1320

docs/sphinx/auth.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
.. _auth:
3+
4+
SDSS Authentication
5+
===================
6+
7+
For collaboration members, when downloading proprietary collaboration data products,
8+
``sdss_access`` requires authentication using the ``.netrc`` file. To set this up, create or
9+
edit a file in your home called ``.netrc`` and copy the following lines, depending on which
10+
SDSS collaboration you are a member of.
11+
12+
SDSS-IV members
13+
---------------
14+
::
15+
16+
machine data.sdss.org
17+
login <username>
18+
password <password>
19+
20+
21+
SDSS-V members
22+
--------------
23+
::
24+
25+
machine data.sdss5.org
26+
login <username>
27+
password <password>
28+
29+
In the above, replace ``<username>`` and ``<password>`` with your login credentials. The default
30+
SDSS username and password is also acceptable for anonymous access.
31+
**Finally, run** ``chmod 600 ~/.netrc`` **to make the file only accessible to your user.**
32+
33+
.. note::
34+
35+
The default SDSS username and password is different for SDSS-IV and SDSS-V members.

docs/sphinx/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Contents
1818
Installation <installation>
1919
Introduction to sdss_access <intro>
2020
Available sdss-access paths <paths>
21+
Collaboration Authentication <auth>
2122

2223
Reference
2324
---------

docs/sphinx/intro.rst

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ You can download files from the SAS and place them in your local SAS. ``sdss_ac
150150
that mimics the real SAS at Utah. If you do not already have a `SAS_BASE_DIR` set, one will be defined in your
151151
home directory, as a new ``sas`` directory.
152152

153+
``sdss_access`` requires valid authentication to download proprietary data. See :ref:`auth`
154+
for more information.
155+
153156
sdss_access has four classes designed to facilitate access to SAS data.
154157

155158
- **Access** - class that automatically decides between `.RsyncAccess` and `.CurlAccess` based on the operating system.
@@ -235,6 +238,37 @@ In all all cases, successful ``sdss_access`` downloads will return a code of 0.
235238
occurred. If no verbose message is displayed, you may need to check the ``sdss_access_XX.log`` and ``sdss_access_XX.err``
236239
files within the temporary directory.
237240

241+
Accessing SDSS-V Products
242+
-------------------------
243+
244+
As of version 2.0.0, ``sdss_access`` has been updated to support downloading of
245+
SDSS-V products. The usage of ``sdss_access`` remains the same. The only difference is SDSS-V
246+
products are now delivered by the "data.sdss5.org" server instead of "data.sdss.org".
247+
When specifying ``release="sdss5"``, you may notice the new server location, e.g.
248+
::
249+
250+
>>> from sdss_access import Access
251+
>>> access = Access(release='sdss5')
252+
>>> access
253+
<Access(access_mode="rsync", using="data.sdss5.org")>
254+
255+
As with SDSS-IV, ``sdss_access`` requires valid authentication to download
256+
proprietary data for SDSS-V. See :ref:`auth` for more information. Here is an example accessing
257+
the robostrategy completeness files for SDSS-V.
258+
259+
.. warning::
260+
The below example contains large data, ~8 GB, and may take a while to download.
261+
262+
::
263+
264+
from sdss_access import Access
265+
access = Access(release='sdss5')
266+
access.remote()
267+
access.add('rsCompleteness', observatory='apo', plan='epsilon-2-core-*')
268+
access.set_stream()
269+
access.commit()
270+
271+
238272
Accessing Public Data Products
239273
------------------------------
240274

docs/sphinx/path_defs.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ SDSSWORK
1717
:prog: sdsswork
1818
:templates:
1919

20+
.. _dr17:
21+
22+
DR17
23+
----
24+
25+
.. datamodel:: sdss_access.path.path:Path
26+
:prog: DR17
27+
:templates:
2028

2129
.. _dr16:
2230

@@ -99,6 +107,23 @@ DR8
99107
:prog: DR8
100108
:templates:
101109

110+
.. _mpl11:
111+
112+
MPL11
113+
-----
114+
115+
.. datamodel:: sdss_access.path.path:Path
116+
:prog: MPL11
117+
:templates:
118+
119+
.. _mpl10:
120+
121+
MPL10
122+
-----
123+
124+
.. datamodel:: sdss_access.path.path:Path
125+
:prog: MPL10
126+
:templates:
102127

103128
.. _mpl9:
104129

0 commit comments

Comments
 (0)