pzserver 0.3.7__tar.gz → 0.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. pzserver-0.3.8/.github/workflows/README.md +33 -0
  2. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/build-documentation.yml +2 -2
  3. pzserver-0.3.8/.github/workflows/daily-dependency-compatibility.yml +16 -0
  4. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/lowest-versions.yml +3 -4
  5. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/pre-commit-ci.yml +2 -2
  6. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/publish-to-pypi.yml +2 -2
  7. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/rubin-latest-daily-compatibility.yml +4 -4
  8. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/rubin-recommended-compatibility.yml +4 -4
  9. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/smoke-test.yml +2 -2
  10. {pzserver-0.3.7 → pzserver-0.3.8}/.github/workflows/testing-and-coverage.yml +3 -3
  11. pzserver-0.3.8/PKG-INFO +202 -0
  12. pzserver-0.3.8/README.md +153 -0
  13. pzserver-0.3.8/constraints-rubin-latest-daily.txt +13 -0
  14. pzserver-0.3.7/constraints-rubin-latest-daily.txt → pzserver-0.3.8/constraints-rubin-recommended.txt +5 -5
  15. {pzserver-0.3.7 → pzserver-0.3.8}/docs/requirements.txt +1 -1
  16. {pzserver-0.3.7 → pzserver-0.3.8}/requirements-dev.txt +6 -6
  17. pzserver-0.3.8/requirements.txt +13 -0
  18. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/__init__.py +3 -0
  19. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/_version.py +3 -3
  20. pzserver-0.3.8/src/pzserver/auth.py +99 -0
  21. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/communicate.py +26 -8
  22. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/core.py +16 -3
  23. pzserver-0.3.8/src/pzserver/hats_config.py +130 -0
  24. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/process.py +118 -0
  25. pzserver-0.3.8/src/pzserver.egg-info/PKG-INFO +202 -0
  26. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver.egg-info/SOURCES.txt +5 -0
  27. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver.egg-info/requires.txt +13 -13
  28. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver.egg-info/scm_file_list.json +72 -67
  29. pzserver-0.3.8/src/pzserver.egg-info/scm_version.json +8 -0
  30. pzserver-0.3.8/tests/pzserver/conftest.py +14 -0
  31. pzserver-0.3.8/tests/pzserver/test_auth.py +131 -0
  32. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_communicate.py +30 -0
  33. pzserver-0.3.8/tests/pzserver/test_hats_config.py +143 -0
  34. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_process.py +132 -19
  35. pzserver-0.3.7/.github/workflows/README.md +0 -9
  36. pzserver-0.3.7/PKG-INFO +0 -114
  37. pzserver-0.3.7/README.md +0 -65
  38. pzserver-0.3.7/constraints-rubin-recommended.txt +0 -13
  39. pzserver-0.3.7/requirements.txt +0 -13
  40. pzserver-0.3.7/src/pzserver.egg-info/PKG-INFO +0 -114
  41. pzserver-0.3.7/src/pzserver.egg-info/scm_version.json +0 -8
  42. pzserver-0.3.7/tests/pzserver/conftest.py +0 -0
  43. {pzserver-0.3.7 → pzserver-0.3.8}/.copier-answers.yml +0 -0
  44. {pzserver-0.3.7 → pzserver-0.3.8}/.devcontainer/Dockerfile +0 -0
  45. {pzserver-0.3.7 → pzserver-0.3.8}/.devcontainer/devcontainer.json +0 -0
  46. {pzserver-0.3.7 → pzserver-0.3.8}/.devcontainer/docker-compose.yml +0 -0
  47. {pzserver-0.3.7 → pzserver-0.3.8}/.git_archival.txt +0 -0
  48. {pzserver-0.3.7 → pzserver-0.3.8}/.gitattributes +0 -0
  49. {pzserver-0.3.7 → pzserver-0.3.8}/.github/ISSUE_TEMPLATE/0-general_issue.md +0 -0
  50. {pzserver-0.3.7 → pzserver-0.3.8}/.github/ISSUE_TEMPLATE/1-bug_report.md +0 -0
  51. {pzserver-0.3.7 → pzserver-0.3.8}/.github/ISSUE_TEMPLATE/2-feature_request.md +0 -0
  52. {pzserver-0.3.7 → pzserver-0.3.8}/.github/ISSUE_TEMPLATE/README.md +0 -0
  53. {pzserver-0.3.7 → pzserver-0.3.8}/.github/dependabot.yml +0 -0
  54. {pzserver-0.3.7 → pzserver-0.3.8}/.github/pull_request_template.md +0 -0
  55. {pzserver-0.3.7 → pzserver-0.3.8}/.gitignore +0 -0
  56. {pzserver-0.3.7 → pzserver-0.3.8}/.pre-commit-config.yaml +0 -0
  57. {pzserver-0.3.7 → pzserver-0.3.8}/.readthedocs.yml +0 -0
  58. {pzserver-0.3.7 → pzserver-0.3.8}/.setup_dev.sh +0 -0
  59. {pzserver-0.3.7 → pzserver-0.3.8}/LICENSE +0 -0
  60. {pzserver-0.3.7 → pzserver-0.3.8}/__init__.py +0 -0
  61. {pzserver-0.3.7 → pzserver-0.3.8}/docs/Makefile +0 -0
  62. {pzserver-0.3.7 → pzserver-0.3.8}/docs/conf.py +0 -0
  63. {pzserver-0.3.7 → pzserver-0.3.8}/docs/index.rst +0 -0
  64. {pzserver-0.3.7 → pzserver-0.3.8}/docs/installation.rst +0 -0
  65. {pzserver-0.3.7 → pzserver-0.3.8}/docs/make.bat +0 -0
  66. {pzserver-0.3.7 → pzserver-0.3.8}/docs/nbs.rst +0 -0
  67. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/README.md +0 -0
  68. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/examples/upload_example.csv +0 -0
  69. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/examples/upload_example.html +0 -0
  70. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/examples/upload_example.ipynb +0 -0
  71. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/images/crc.png +0 -0
  72. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/images/tsm1.png +0 -0
  73. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/images/tsm2.png +0 -0
  74. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/pzserver_tutorial.ipynb +0 -0
  75. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rsp_instructions.md +0 -0
  76. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rst/output_70_1.png +0 -0
  77. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rst/output_71_1.png +0 -0
  78. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rst/output_78_1.png +0 -0
  79. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rst/output_79_1.png +0 -0
  80. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/rst/pzserver_tutorial.rst +0 -0
  81. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/DESI-DR1-QA-Notebook-NO-CODE.html +0 -0
  82. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/DESI-DR1-QA-Notebook-WITH-CODE.html +0 -0
  83. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/DESI-DR1-QA-Notebook.ipynb +0 -0
  84. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/desi_qa_env.yaml +0 -0
  85. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/desi_qa_instructions.md +0 -0
  86. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/mollweide_spatial_distribution.html +0 -0
  87. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_dr1_qa_from_disk/plate_carree_spatial_distribution.html +0 -0
  88. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/desi_edr_galaxies.ipynb +0 -0
  89. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/public-specz-compilation.ipynb +0 -0
  90. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/public-training-set-des-dr2.ipynb +0 -0
  91. {pzserver-0.3.7 → pzserver-0.3.8}/docs/notebooks/templates/ztrue_tract_3833.ipynb +0 -0
  92. {pzserver-0.3.7 → pzserver-0.3.8}/docs/pre_executed/README.md +0 -0
  93. {pzserver-0.3.7 → pzserver-0.3.8}/pyproject.toml +0 -0
  94. {pzserver-0.3.7 → pzserver-0.3.8}/setup.cfg +0 -0
  95. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/catalog.py +0 -0
  96. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/pipeline.py +0 -0
  97. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/product.py +0 -0
  98. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver/upload.py +0 -0
  99. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver.egg-info/dependency_links.txt +0 -0
  100. {pzserver-0.3.7 → pzserver-0.3.8}/src/pzserver.egg-info/top_level.txt +0 -0
  101. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_catalog.py +0 -0
  102. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_core.py +0 -0
  103. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_download.py +0 -0
  104. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_get_product.py +0 -0
  105. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_packaging.py +0 -0
  106. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_pipeline.py +0 -0
  107. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_product.py +0 -0
  108. {pzserver-0.3.7 → pzserver-0.3.8}/tests/pzserver/test_upload.py +0 -0
@@ -0,0 +1,33 @@
1
+ # Workflows
2
+
3
+ The .yml files in this directory are used to define the various continuous
4
+ integration scripts that will be run on your behalf e.g. nightly as a smoke check,
5
+ or when you create a new PR.
6
+
7
+ For more information about CI and workflows, look here: https://lincc-ppt.readthedocs.io/en/latest/practices/ci.html
8
+
9
+ Or if you still have questions contact us: https://lincc-ppt.readthedocs.io/en/latest/source/contact.html
10
+
11
+ ## Dependency compatibility checks
12
+
13
+ The lowest-version and Rubin compatibility workflows run on pull requests,
14
+ pushes to `main`, and manual dispatches. They do not contain scheduled triggers,
15
+ so GitHub cannot disable required pull-request checks when scheduled workflows
16
+ are disabled because of repository inactivity.
17
+
18
+ `daily-dependency-compatibility.yml` owns the daily schedule and calls these
19
+ workflows through `workflow_call`:
20
+
21
+ - `lowest-versions.yml`
22
+ - `rubin-recommended-compatibility.yml`
23
+ - `rubin-latest-daily-compatibility.yml`
24
+
25
+ The following checks should be required by the `main` branch protection rule:
26
+
27
+ - `pre-commit-ci`
28
+ - `lowest_direct_dependencies`
29
+ - `rubin_recommended_compatibility`
30
+ - `rubin_latest_daily_compatibility`
31
+ - `test_and_coverage (3.11)`
32
+ - `test_and_coverage (3.12)`
33
+ - `test_and_coverage (3.13)`
@@ -16,9 +16,9 @@ jobs:
16
16
  runs-on: ubuntu-latest
17
17
 
18
18
  steps:
19
- - uses: actions/checkout@v6
19
+ - uses: actions/checkout@v7
20
20
  - name: Set up Python 3.11
21
- uses: actions/setup-python@v6
21
+ uses: actions/setup-python@v7
22
22
  with:
23
23
  python-version: '3.11'
24
24
  - name: Install uv
@@ -0,0 +1,16 @@
1
+ name: Daily dependency compatibility
2
+
3
+ on:
4
+ schedule:
5
+ - cron: 15 7 * * *
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ lowest-versions:
10
+ uses: ./.github/workflows/lowest-versions.yml
11
+
12
+ rubin-recommended:
13
+ uses: ./.github/workflows/rubin-recommended-compatibility.yml
14
+
15
+ rubin-latest-daily:
16
+ uses: ./.github/workflows/rubin-latest-daily-compatibility.yml
@@ -7,9 +7,8 @@ on:
7
7
  branches: [ main ]
8
8
  pull_request:
9
9
  branches: [ main ]
10
- schedule:
11
- - cron: 45 8 * * *
12
10
  workflow_dispatch:
11
+ workflow_call:
13
12
 
14
13
  jobs:
15
14
  lowest-direct:
@@ -17,9 +16,9 @@ jobs:
17
16
  runs-on: ubuntu-latest
18
17
 
19
18
  steps:
20
- - uses: actions/checkout@v6
19
+ - uses: actions/checkout@v7
21
20
  - name: Set up Python 3.11
22
- uses: actions/setup-python@v6
21
+ uses: actions/setup-python@v7
23
22
  with:
24
23
  python-version: '3.11'
25
24
  - name: Install uv
@@ -14,11 +14,11 @@ jobs:
14
14
  pre-commit-ci:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v6
17
+ - uses: actions/checkout@v7
18
18
  with:
19
19
  fetch-depth: 0
20
20
  - name: Set up Python
21
- uses: actions/setup-python@v6
21
+ uses: actions/setup-python@v7
22
22
  with:
23
23
  python-version: '3.11'
24
24
  - name: Install uv
@@ -19,9 +19,9 @@ jobs:
19
19
  permissions:
20
20
  id-token: write
21
21
  steps:
22
- - uses: actions/checkout@v6
22
+ - uses: actions/checkout@v7
23
23
  - name: Set up Python
24
- uses: actions/setup-python@v6
24
+ uses: actions/setup-python@v7
25
25
  with:
26
26
  python-version: '3.11'
27
27
  - name: Install dependencies
@@ -5,8 +5,8 @@ on:
5
5
  branches: [ main ]
6
6
  pull_request:
7
7
  branches: [ main ]
8
- schedule:
9
- - cron: 45 7 * * *
8
+ workflow_dispatch:
9
+ workflow_call:
10
10
 
11
11
  jobs:
12
12
  rubin-latest-daily-compatibility:
@@ -14,9 +14,9 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v6
17
+ - uses: actions/checkout@v7
18
18
  - name: Set up Python 3.13
19
- uses: actions/setup-python@v6
19
+ uses: actions/setup-python@v7
20
20
  with:
21
21
  python-version: '3.13'
22
22
  - name: Install dependencies with Rubin Latest Daily constraints
@@ -5,8 +5,8 @@ on:
5
5
  branches: [ main ]
6
6
  pull_request:
7
7
  branches: [ main ]
8
- schedule:
9
- - cron: 15 7 * * *
8
+ workflow_dispatch:
9
+ workflow_call:
10
10
 
11
11
  jobs:
12
12
  rubin-recommended-compatibility:
@@ -14,9 +14,9 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
 
16
16
  steps:
17
- - uses: actions/checkout@v6
17
+ - uses: actions/checkout@v7
18
18
  - name: Set up Python 3.12
19
- uses: actions/setup-python@v6
19
+ uses: actions/setup-python@v7
20
20
  with:
21
21
  python-version: '3.12'
22
22
  - name: Install dependencies with Rubin Recommended constraints
@@ -18,9 +18,9 @@ jobs:
18
18
  python-version: ['3.11', '3.12', '3.13']
19
19
 
20
20
  steps:
21
- - uses: actions/checkout@v6
21
+ - uses: actions/checkout@v7
22
22
  - name: Set up Python ${{ matrix.python-version }}
23
- uses: actions/setup-python@v6
23
+ uses: actions/setup-python@v7
24
24
  with:
25
25
  python-version: ${{ matrix.python-version }}
26
26
  - name: Install uv
@@ -17,9 +17,9 @@ jobs:
17
17
  python-version: ['3.11', '3.12', '3.13']
18
18
 
19
19
  steps:
20
- - uses: actions/checkout@v6
20
+ - uses: actions/checkout@v7
21
21
  - name: Set up Python ${{ matrix.python-version }}
22
- uses: actions/setup-python@v6
22
+ uses: actions/setup-python@v7
23
23
  with:
24
24
  python-version: ${{ matrix.python-version }}
25
25
  - name: Install uv
@@ -33,6 +33,6 @@ jobs:
33
33
  run: |
34
34
  python -m pytest --cov=pzserver --cov-report=xml
35
35
  - name: Upload coverage report to codecov
36
- uses: codecov/codecov-action@v5
36
+ uses: codecov/codecov-action@v7
37
37
  with:
38
38
  token: ${{ secrets.CODECOV_TOKEN }}
@@ -0,0 +1,202 @@
1
+ Metadata-Version: 2.4
2
+ Name: pzserver
3
+ Version: 0.3.8
4
+ Author-email: LIneA <itteam@linea.org.br>
5
+ License-Expression: MIT
6
+ Project-URL: Source Code, https://github.com/linea-it/pzserver
7
+ Classifier: Development Status :: 4 - Beta
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Requires-Python: <3.14,>=3.11
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: astropy<9,>=7.2.0
19
+ Requires-Dist: Deprecated<4,>=1
20
+ Requires-Dist: h5py<4,>=3.8
21
+ Requires-Dist: ipython<10,>=9.15.0
22
+ Requires-Dist: Jinja2<4,>=3.1.2
23
+ Requires-Dist: lsdb<1,>=0.6.4
24
+ Requires-Dist: matplotlib<4,>=3.9
25
+ Requires-Dist: numpy<3,>=2.3.5
26
+ Requires-Dist: pandas<4,>=2.3.3
27
+ Requires-Dist: pyarrow>=17
28
+ Requires-Dist: pydantic<3,>=2
29
+ Requires-Dist: requests<3,>=2.34.2
30
+ Requires-Dist: tables-io<2,>=1.1.2
31
+ Provides-Extra: dev
32
+ Requires-Dist: pytest>=9.1.1; extra == "dev"
33
+ Requires-Dist: pytest-cov>=4; extra == "dev"
34
+ Requires-Dist: pre-commit>=3; extra == "dev"
35
+ Requires-Dist: ruff>=0.2; extra == "dev"
36
+ Requires-Dist: sphinx<8,>=7.0.0; extra == "dev"
37
+ Requires-Dist: sphinx_rtd_theme<4,>=3.1.0; extra == "dev"
38
+ Requires-Dist: sphinx-autoapi<4,>=3.0.0; extra == "dev"
39
+ Requires-Dist: sphinx-copybutton<1,>=0.5.0; extra == "dev"
40
+ Requires-Dist: pylint>=4.0.6; extra == "dev"
41
+ Requires-Dist: ipykernel>=6; extra == "dev"
42
+ Requires-Dist: nbconvert>=7.17.1; extra == "dev"
43
+ Requires-Dist: nbsphinx>=0.9; extra == "dev"
44
+ Requires-Dist: ipython>=9.15.0; extra == "dev"
45
+ Requires-Dist: jupyterlab>=4; extra == "dev"
46
+ Requires-Dist: matplotlib; extra == "dev"
47
+ Requires-Dist: ghp-import>=2.1.0; extra == "dev"
48
+ Dynamic: license-file
49
+
50
+ # PZ Server Library
51
+
52
+ ![PyPI](https://img.shields.io/pypi/v/pzserver?label=PyPI)
53
+ ![PyPI - Status](https://img.shields.io/pypi/status/pzserver)
54
+ ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/linea-it/pzserver/build-documentation.yml?label=docs)
55
+ ![GitHub](https://img.shields.io/github/license/linea-it/pzserver)
56
+
57
+ A Python library to access data and services from the LSST [Photo-z Server](https://pz-server.linea.org.br/).
58
+
59
+ The Photo-z (PZ) Server is an online service based on software developed and delivered as part of the in-kind contribution program BRA-LIN, from LIneA to the Legacy Survey of Space and Time (LSST) caried out by the [Rubin Observatory](https://rubinobservatory.org/). The PZ Server is an open source project. The source code is available on the GitHub repository [linea-it/pzserver](https://github.com/linea-it/pzserver).
60
+
61
+ An overview of this and other contributions is available [here](https://linea-it.github.io/pz-lsst-inkind-doc/).
62
+ The API documentation is available [here](https://linea-it.github.io/pzserver).
63
+
64
+
65
+ This repo uses the [LINCC's Python Project Template](https://github.com/lincc-frameworks/python-project-template), described in the article: [A Python Project Template for Healthy Scientific Software](https://iopscience.iop.org/article/10.3847/2515-5172/ad4da1).
66
+
67
+
68
+ ---
69
+
70
+ ## Save your API token once
71
+
72
+ In your notebook or Python session, register the token generated on the PZ
73
+ Server website. The prompt hides your input, and the token is validated before
74
+ being saved:
75
+
76
+ ```python
77
+ from pzserver import PzServer, login, logout
78
+
79
+ login() # First use only: enter your token in the hidden prompt.
80
+ pz = PzServer()
81
+ ```
82
+
83
+ In later sessions, including after kernel or Jupyter server restarts, use only:
84
+
85
+ ```python
86
+ from pzserver import PzServer
87
+
88
+ pz = PzServer()
89
+ ```
90
+
91
+ Tokens are stored **unencrypted** in `~/.pzserver/credentials`, outside your
92
+ notebooks. On POSIX systems, the credentials directory has permissions `0700`
93
+ and token files have permissions `0600`. Processes running as your user can
94
+ read them. On other systems, protect your home directory with the operating
95
+ system's access controls. Your home directory must be persistent for credentials
96
+ to survive a server restart; another environment needs its own login.
97
+
98
+ Credentials are stored separately for each API endpoint. For development, use
99
+ `login(host="pz-dev")` followed by `PzServer(host="pz-dev")`. Custom API URLs
100
+ are also supported. Only enter a token for an API you trust, using HTTPS for
101
+ remote servers.
102
+
103
+ Explicit credentials still work with `PzServer(token=token)` and take precedence
104
+ over saved credentials without saving or replacing them. If no saved token
105
+ exists, `PzServer()` raises an error directing you to `login()`; it never opens
106
+ an unexpected prompt. To replace an expired or revoked token, run `login()`
107
+ again. Tokens are not automatically renewed.
108
+
109
+ Use `logout()` (or `logout(host="pz-dev")`) to delete the local credential.
110
+ This does not revoke the token on the API or disconnect existing Python
111
+ instances. Revocation must be done on the PZ Server website.
112
+
113
+ ## Partner JupyterHub authentication
114
+
115
+ Once the PzServer API administrator has enabled the `linea-dev` partner and
116
+ confirmed your active PzServer account has exactly the same username, you can use:
117
+
118
+ ```python
119
+ pz = PzServer(host="pz-dev", hub="linea-dev")
120
+ ```
121
+
122
+ This reads `JUPYTERHUB_API_TOKEN` from the notebook environment without saving
123
+ it. For `PzServer()` without an explicit token or partner, saved PzServer
124
+ credentials take precedence; otherwise the package recognizes the LIneA dev
125
+ Hub via `JUPYTERHUB_PUBLIC_HUB_URL` or `JUPYTERHUB_HOST`. If those variables
126
+ are unavailable, specify `hub="linea-dev"`. Explicit `token=...` always wins.
127
+
128
+ Partner credentials are sent only to the known production/development
129
+ PzServer API URLs, never automatically to a custom `host`. The API validates
130
+ the token with its configured partner endpoint and requires an active local
131
+ account with exactly the same username. It applies that account's permissions. Rubin/Nublado is not supported by this integration.
132
+ The backend must be deployed and configured before this mode will work.
133
+
134
+ ## Training Set Maker HATS configuration
135
+
136
+ Select the release before setting the photometric options. The package fetches
137
+ that release's editable HATS configuration and submits the effective object with
138
+ the process. Flux output is the default:
139
+
140
+ ```python
141
+ tsm = pz.training_set_maker("DP1 training set")
142
+ tsm.set_release(name="dp1")
143
+ tsm.set_config(
144
+ {
145
+ "flux_type": "cModel",
146
+ "dereddening": "none",
147
+ "convert_flux_to_mag": False,
148
+ }
149
+ )
150
+ ```
151
+
152
+ The flux type and dereddening value must be among the options exposed by the
153
+ selected release. Magnitude conversion is accepted only when the release has
154
+ enabled it. Advanced callers may provide a complete editable configuration as
155
+ the `hats_config` dictionary. Infrastructure paths and executor settings are
156
+ restored by the server and cannot be overridden by the client.
157
+
158
+ ## Instructions for developers:
159
+
160
+ ### How to validate a PR
161
+
162
+ Step-by-step procedure to test a new feature or bug fix from a particular branch not using a previously installed version (not the only way, just a suggestion):
163
+
164
+ 1. Clone the repository (first time only).
165
+
166
+ ```
167
+ git clone git@github.com:linea-it/pzserver.git
168
+ # or git clone https://github.com/linea-it/pzserver.git
169
+ ```
170
+ </p>
171
+
172
+ 2. Enter the repository and checkout to the development branch.
173
+
174
+ ```
175
+ cd pzserver
176
+ git fetch origin
177
+ git checkout <development branch name>
178
+ git pull
179
+ ```
180
+ </p>
181
+
182
+ 3. Create a new Conda environment free from `pzserver` old version installation. Delete any existing one with the same same, if necessary.
183
+
184
+ ```
185
+ conda remove --name pzserver --all
186
+ conda create -n pzserver python=3.12
187
+ conda activate pzserver
188
+ conda install pip
189
+ python -m pip install -e '.[dev]'
190
+ python -m ipykernel install --user --name pzserver --display-name "Python (pzserver)"
191
+ ```
192
+ </p>
193
+
194
+ 4. Open Python prompt or notebook and import the library:
195
+
196
+ ```
197
+ from pzserver import PzServer
198
+ token = "****" # your toker
199
+ pz = PzServer(token)
200
+ ```
201
+
202
+ ---
@@ -0,0 +1,153 @@
1
+ # PZ Server Library
2
+
3
+ ![PyPI](https://img.shields.io/pypi/v/pzserver?label=PyPI)
4
+ ![PyPI - Status](https://img.shields.io/pypi/status/pzserver)
5
+ ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/linea-it/pzserver/build-documentation.yml?label=docs)
6
+ ![GitHub](https://img.shields.io/github/license/linea-it/pzserver)
7
+
8
+ A Python library to access data and services from the LSST [Photo-z Server](https://pz-server.linea.org.br/).
9
+
10
+ The Photo-z (PZ) Server is an online service based on software developed and delivered as part of the in-kind contribution program BRA-LIN, from LIneA to the Legacy Survey of Space and Time (LSST) caried out by the [Rubin Observatory](https://rubinobservatory.org/). The PZ Server is an open source project. The source code is available on the GitHub repository [linea-it/pzserver](https://github.com/linea-it/pzserver).
11
+
12
+ An overview of this and other contributions is available [here](https://linea-it.github.io/pz-lsst-inkind-doc/).
13
+ The API documentation is available [here](https://linea-it.github.io/pzserver).
14
+
15
+
16
+ This repo uses the [LINCC's Python Project Template](https://github.com/lincc-frameworks/python-project-template), described in the article: [A Python Project Template for Healthy Scientific Software](https://iopscience.iop.org/article/10.3847/2515-5172/ad4da1).
17
+
18
+
19
+ ---
20
+
21
+ ## Save your API token once
22
+
23
+ In your notebook or Python session, register the token generated on the PZ
24
+ Server website. The prompt hides your input, and the token is validated before
25
+ being saved:
26
+
27
+ ```python
28
+ from pzserver import PzServer, login, logout
29
+
30
+ login() # First use only: enter your token in the hidden prompt.
31
+ pz = PzServer()
32
+ ```
33
+
34
+ In later sessions, including after kernel or Jupyter server restarts, use only:
35
+
36
+ ```python
37
+ from pzserver import PzServer
38
+
39
+ pz = PzServer()
40
+ ```
41
+
42
+ Tokens are stored **unencrypted** in `~/.pzserver/credentials`, outside your
43
+ notebooks. On POSIX systems, the credentials directory has permissions `0700`
44
+ and token files have permissions `0600`. Processes running as your user can
45
+ read them. On other systems, protect your home directory with the operating
46
+ system's access controls. Your home directory must be persistent for credentials
47
+ to survive a server restart; another environment needs its own login.
48
+
49
+ Credentials are stored separately for each API endpoint. For development, use
50
+ `login(host="pz-dev")` followed by `PzServer(host="pz-dev")`. Custom API URLs
51
+ are also supported. Only enter a token for an API you trust, using HTTPS for
52
+ remote servers.
53
+
54
+ Explicit credentials still work with `PzServer(token=token)` and take precedence
55
+ over saved credentials without saving or replacing them. If no saved token
56
+ exists, `PzServer()` raises an error directing you to `login()`; it never opens
57
+ an unexpected prompt. To replace an expired or revoked token, run `login()`
58
+ again. Tokens are not automatically renewed.
59
+
60
+ Use `logout()` (or `logout(host="pz-dev")`) to delete the local credential.
61
+ This does not revoke the token on the API or disconnect existing Python
62
+ instances. Revocation must be done on the PZ Server website.
63
+
64
+ ## Partner JupyterHub authentication
65
+
66
+ Once the PzServer API administrator has enabled the `linea-dev` partner and
67
+ confirmed your active PzServer account has exactly the same username, you can use:
68
+
69
+ ```python
70
+ pz = PzServer(host="pz-dev", hub="linea-dev")
71
+ ```
72
+
73
+ This reads `JUPYTERHUB_API_TOKEN` from the notebook environment without saving
74
+ it. For `PzServer()` without an explicit token or partner, saved PzServer
75
+ credentials take precedence; otherwise the package recognizes the LIneA dev
76
+ Hub via `JUPYTERHUB_PUBLIC_HUB_URL` or `JUPYTERHUB_HOST`. If those variables
77
+ are unavailable, specify `hub="linea-dev"`. Explicit `token=...` always wins.
78
+
79
+ Partner credentials are sent only to the known production/development
80
+ PzServer API URLs, never automatically to a custom `host`. The API validates
81
+ the token with its configured partner endpoint and requires an active local
82
+ account with exactly the same username. It applies that account's permissions. Rubin/Nublado is not supported by this integration.
83
+ The backend must be deployed and configured before this mode will work.
84
+
85
+ ## Training Set Maker HATS configuration
86
+
87
+ Select the release before setting the photometric options. The package fetches
88
+ that release's editable HATS configuration and submits the effective object with
89
+ the process. Flux output is the default:
90
+
91
+ ```python
92
+ tsm = pz.training_set_maker("DP1 training set")
93
+ tsm.set_release(name="dp1")
94
+ tsm.set_config(
95
+ {
96
+ "flux_type": "cModel",
97
+ "dereddening": "none",
98
+ "convert_flux_to_mag": False,
99
+ }
100
+ )
101
+ ```
102
+
103
+ The flux type and dereddening value must be among the options exposed by the
104
+ selected release. Magnitude conversion is accepted only when the release has
105
+ enabled it. Advanced callers may provide a complete editable configuration as
106
+ the `hats_config` dictionary. Infrastructure paths and executor settings are
107
+ restored by the server and cannot be overridden by the client.
108
+
109
+ ## Instructions for developers:
110
+
111
+ ### How to validate a PR
112
+
113
+ Step-by-step procedure to test a new feature or bug fix from a particular branch not using a previously installed version (not the only way, just a suggestion):
114
+
115
+ 1. Clone the repository (first time only).
116
+
117
+ ```
118
+ git clone git@github.com:linea-it/pzserver.git
119
+ # or git clone https://github.com/linea-it/pzserver.git
120
+ ```
121
+ </p>
122
+
123
+ 2. Enter the repository and checkout to the development branch.
124
+
125
+ ```
126
+ cd pzserver
127
+ git fetch origin
128
+ git checkout <development branch name>
129
+ git pull
130
+ ```
131
+ </p>
132
+
133
+ 3. Create a new Conda environment free from `pzserver` old version installation. Delete any existing one with the same same, if necessary.
134
+
135
+ ```
136
+ conda remove --name pzserver --all
137
+ conda create -n pzserver python=3.12
138
+ conda activate pzserver
139
+ conda install pip
140
+ python -m pip install -e '.[dev]'
141
+ python -m ipykernel install --user --name pzserver --display-name "Python (pzserver)"
142
+ ```
143
+ </p>
144
+
145
+ 4. Open Python prompt or notebook and import the library:
146
+
147
+ ```
148
+ from pzserver import PzServer
149
+ token = "****" # your toker
150
+ pz = PzServer(token)
151
+ ```
152
+
153
+ ---
@@ -0,0 +1,13 @@
1
+ astropy==8.0.1
2
+ Deprecated==3.0.0
3
+ h5py==3.16.0
4
+ ipython==9.17.1
5
+ Jinja2==3.1.6
6
+ lsdb==0.10.4
7
+ matplotlib==3.10.9
8
+ numpy==2.4.6
9
+ pandas==2.3.3
10
+ pyarrow==24.0.0
11
+ pydantic==2.14.1
12
+ requests==2.34.2
13
+ tables-io==1.1.3
@@ -1,13 +1,13 @@
1
- astropy==8.0.1
1
+ astropy==7.2.0
2
2
  Deprecated==1.3.1
3
3
  h5py==3.16.0
4
- ipython==9.15.0
4
+ ipython==9.16.1
5
5
  Jinja2==3.1.6
6
- lsdb==0.10.2
6
+ lsdb==0.10.4
7
7
  matplotlib==3.10.9
8
- numpy==2.4.6
8
+ numpy==2.3.5
9
9
  pandas==2.3.3
10
- pyarrow==23.0.0
10
+ pyarrow==21.0.0
11
11
  pydantic==2.13.4
12
12
  requests==2.34.2
13
13
  tables-io==1.1.2
@@ -1,5 +1,5 @@
1
1
  sphinx>=7.0.0,<8
2
- sphinx_rtd_theme>=1.2.0,<2
2
+ sphinx_rtd_theme>=3.1.0,<4
3
3
  sphinx-autoapi>=3.0.0,<4
4
4
  sphinx-copybutton>=0.5.0,<1
5
5
  nbsphinx
@@ -1,16 +1,16 @@
1
- pytest>=7
1
+ pytest>=9.1.1
2
2
  pytest-cov>=4
3
3
  pre-commit>=3
4
4
  ruff>=0.2
5
5
  sphinx>=7.0.0,<8
6
- sphinx_rtd_theme>=1.2.0,<2
6
+ sphinx_rtd_theme>=3.1.0,<4
7
7
  sphinx-autoapi>=3.0.0,<4
8
8
  sphinx-copybutton>=0.5.0,<1
9
- pylint>=3
9
+ pylint>=4.0.6
10
10
  ipykernel>=6
11
- nbconvert>=7
11
+ nbconvert>=7.17.1
12
12
  nbsphinx>=0.9
13
- ipython>=8
13
+ ipython>=9.15.0
14
14
  jupyterlab>=4
15
15
  matplotlib
16
- ghp-import>=2
16
+ ghp-import>=2.1.0
@@ -0,0 +1,13 @@
1
+ astropy>=7.2.0,<9
2
+ Deprecated>=1,<4
3
+ h5py>=3.8,<4
4
+ ipython>=9.15.0,<10
5
+ Jinja2>=3.1.2,<4
6
+ lsdb>=0.6.4,<1
7
+ matplotlib>=3.9,<4
8
+ numpy>=2.3.5,<3
9
+ pandas>=2.3.3,<4
10
+ pyarrow>=17
11
+ pydantic>=2,<3
12
+ requests>=2.34.2,<3
13
+ tables-io>=1.1.2,<2
@@ -5,6 +5,7 @@ SpeczCatalog:
5
5
  TrainingSet:
6
6
  """
7
7
 
8
+ from .auth import login, logout
8
9
  from .catalog import Catalog, SpeczCatalog, TrainingSet
9
10
  from .core import PzServer
10
11
  from .pipeline import Pipeline
@@ -17,6 +18,8 @@ __all__ = [
17
18
  "TrainingSet",
18
19
  "__version__",
19
20
  "get_version",
21
+ "login",
22
+ "logout",
20
23
  ]
21
24
 
22
25
  # Import version information
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '0.3.7'
22
- __version_tuple__ = version_tuple = (0, 3, 7)
21
+ __version__ = version = '0.3.8'
22
+ __version_tuple__ = version_tuple = (0, 3, 8)
23
23
 
24
- __commit_id__ = commit_id = 'g525f3f740'
24
+ __commit_id__ = commit_id = 'g02289880d'