Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap to gwemopt v0.2, and latest winterapi #73

Merged
merged 7 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
name: Black

on:
push:
pull_request:
merge_group:
on: [push, pull_request]

jobs:
black:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: pipx install poetry
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
python-version: 3.11
cache: 'pip'
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install --upgrade pip
python -m pip install --upgrade poetry
poetry config installer.modern-installation false
poetry install
pip install --editable ".[dev]"
- name: Reformat the code with black
run: |
poetry run black . --check
black . --check
92 changes: 0 additions & 92 deletions .github/workflows/continous_integration.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events
push:

pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Specify the python versions to test
strategy:
matrix:
python-version: ["3.10", "3.11"]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Set up the python versions
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: install packages
run: |
pip install --editable ".[dev]"

# Runs a set of commands using the runners shell
- name: Test the code
env:
KOWALSKI_API_TOKEN: ${{ secrets.KOWALSKI_API_TOKEN }}
run: |
coverage run -m unittest discover tests

- name: Run Coveralls
continue-on-error: true
if: ${{ success() }}
run: |
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Echo tag name
run: echo "Tag is ${{ github.ref }}, Deploy is ${{ startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.9}}"

- name: Install pypa/build
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish distribution 📦 to PyPI
if: ${{ startsWith(github.ref, 'refs/tags/') && success() && matrix.python-version == 3.9}}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
5 changes: 0 additions & 5 deletions .gitmodules

This file was deleted.

12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ We suggest using a conda environment to install `snipergw`, with python>=3.10.
You can then install the package using `pip` and `poetry`:

```
git clone --recurse-submodules [email protected]:robertdstein/snipergw.git
git clone [email protected]:robertdstein/snipergw.git
cd snipergw
pip install poetry
poetry install
pip install -e .
pre-commit install
```

Make sure not to miss the `--recurse-submodules` flag, as this is required to download the `gwemopt` submodule.

Sometimes, if you are using a conda environment, you might need to run `poetry install` twice.
If you still have problems, try installing troublesome packages with `conda`, and then do `pip install -e .` instead of `poetry install`.

Note for ARM-based macs: The installation of `fiona` might fail if you do not have [gdal](https://gdal.org/) installed. In that case, consider using a `conda` and running `conda install -c conda-forge gdal` before running `poetry install`.
Note for ARM-based macs: The installation of `fiona` might fail if you do not have [gdal](https://gdal.org/) installed. In that case, consider using a `conda` and running `conda install -c conda-forge gdal` before running `pip install`.

If you want to generate movies, you also need to install `ffmpeg`, which you can do via `brew install ffmpeg` or `conda install -c conda-forge ffmpeg`.

## Usage

To use this functionality, you must first configure the connection details. Thos is instrument-specific.
To use this functionality, you must first configure the connection details. This is instrument-specific.

### ZTF
You need both an API token, and to know the address of the Kowalski host address. You can then set these as environment variables:
Expand Down
Loading
Loading