Skip to content

Commit

Permalink
Merge pull request #85 from GreenBankObservatory/cat-devel-merger
Browse files Browse the repository at this point in the history
Cat devel merger
  • Loading branch information
mpound authored Oct 6, 2023
2 parents f91a2e0 + c6394b2 commit 8d77763
Show file tree
Hide file tree
Showing 43 changed files with 362 additions and 167 deletions.
8 changes: 8 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Template environment file for building the docs
# Copy this to .env, then edit all indicated lines

# Documentation Settings
export DOCS_ROOT="path/to/dysh/docs" # EDIT ME
export DOCS_HOST="" # EDIT ME
export DOCS_PORT="" # EDIT ME
alias startdocs="cd $DOCS_ROOT && cd source && sphinx-autobuild . _build -b html --host $DOCS_HOST --port $DOCS_PORT"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
pip install -e .
- name: Build with hatch
run: |
hatch build -c
hatch build -c
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Build and Pytest

on:
push:
branches: [ "main", "release-0.1.0", "cat-devel", "mwp-devel", "pedro-devel" ]
branches: [ "main", "release-0.2.0", "cat-devel", "mwp-devel", "pedro-devel" ]
pull_request:
branches: [ "main", "release-0.1.0", "cat-devel", "mwp-devel", "pedro-devel" ]
branches: [ "main", "release-0.2.0", "cat-devel", "mwp-devel", "pedro-devel" ]
jobs:
build:
runs-on: ${{ matrix.os }}
environment: hatch build

strategy:
fail-fast: false
Expand All @@ -27,9 +28,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
pip install -r requirements.txt
pip install -e .
- name: Build with hatch
run: |
hatch build -c
- name: Test with pytest
run: |
pytest
38 changes: 38 additions & 0 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@

name: Package GUI with Pyinstaller

on:
push:
branches: [ "cat-devel" ]
pull_request:
branches: [ "cat-devel" ]

jobs:
build:
runs-on: ${{ matrix.os }}
environment: hatch build

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
- name: Build with hatch
run: |
hatch build -c
- name: Package GUI with PyInstaller
run: |
cd gui
pyinstaller app.py
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: "3.x"
python-version: ["3.x"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -23,9 +23,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -r requirements.txt
pip install -e .
- name: Build with hatch
run: |
hatch build -c
pypi-publish:
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Custom
*.fits
.ignore/
docs/source/_build/
gui/build
gui/dist

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,39 +47,50 @@ The usual caveats apply how you set up your python development environment.
$ pip install hatch
```

2. Create and activate a virtual environment with hatch and install the packages required for development.
2. Hatch will default to using the system Python if there's no ``HATCH_PYTHON`` environment variable set. To use a specific version of Python, add the following line to your ``~/.bash_profile``:

```
export HATCH_PYTHON=/path/to/bin/python
```

Then source the new profile to apply the changes.

```bash
$ source ~/.bash_profile
```

3. Create and activate a virtual environment with hatch and install the packages required for development.
The virtual environment will be created the first time; subsequent invoking ``hatch shell`` will simply load the created environment.cdi

```bash
$ hatch shell
(dysh) $ pip install -r requirements_dev.txt
(dysh) $ pip install -r requirements.txt
```

3. Build and install the package
4. Build and install the package

```bash
(dysh) $ hatch build
(dysh) $ pip install -e .
```

4. You can exit this environment (which effectively had started a new shell) just exit:
5. You can exit this environment (which effectively had started a new shell) just exit:

```bash
(dysh) $ exit
$
```

4. Each time when you come back in this directory without being in this virtual environment, you'll need to load the virtual environment
6. Each time when you come back in this directory without being in this virtual environment, you'll need to load the virtual environment

```bash
$ hatch shell
```
Notice you can ONLY do that from this directory

Notice you can ONLY do that from this directory

## Testing
We use pytest for unit and integration testing. From the top-level dysh directory, run:

```bash
$ pytest
```

8 changes: 0 additions & 8 deletions docs/.env.template

This file was deleted.

72 changes: 0 additions & 72 deletions docs/requirements.txt

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion docs/source/background/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Why does this exist?
:maxdepth: 2

gbo_context
sdfits_files
sdfits_files/index
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
************
SDFITS Files
************
****************
GBT SDFITS Files
****************

Overview
========
The single-dish FITS (SDFITS) convention is used for observer-facing GBT data. The GBT records raw data to FITS files, and then the SDFITS filler populates SDFITS files with information the observer needs.

GBT Convention
=================

GBT SDFITS files contain 2 Header-Data Units (HDUs). Note that keys sometimes appear to be truncated because they can only have up to 8 letters.
Convention
==========
The single-dish FITS (SDFITS) convention is used for observer-facing GBT data. The GBT records raw data to FITS files, and then the SDFITS filler populates SDFITS files with information the observer needs. GBT SDFITS files contain 2 or more Header-Data Units (HDUs). Note that keys sometimes appear to be truncated because they can only have up to 8 letters.

HDU 0 (PRIMARY)
---------------
Expand Down
10 changes: 10 additions & 0 deletions docs/source/background/sdfits_files/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
************
SDFITS Files
************

Here are some of the telescopes which use SDFITS files.

.. toctree::
:maxdepth: 2

gbt_sdfits
File renamed without changes.
3 changes: 2 additions & 1 deletion docs/source/design/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Stuff about the overall design
.. toctree::
:maxdepth: 2

sdfits_loaders
sdfits_loaders
structure
30 changes: 30 additions & 0 deletions docs/source/design/structure.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
*********
Structure
*********

.. mermaid::

erDiagram
SESSION {
int session_id PK, FK
int obsblock_id FK
}
OBSBLOCK {
int obsblock_id PK, FK
int spectrum_id FK
int flag
}
SPECTRUM {
int spectrum_id PK, FK
int flag
}
SPECTRUM_DATA {
int spectrum_id PK, FK
list flags
list frequencies
list intensities
}

SESSION ||--|{ OBSBLOCK : "has one or more"
OBSBLOCK ||--|{ SPECTRUM : "has one or more"
SPECTRUM ||--|| SPECTRUM_DATA : "has one"
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 8d77763

Please sign in to comment.