Skip to content

Commit

Permalink
Merge pull request #1 from winter-telescope/initial-setup
Browse files Browse the repository at this point in the history
Initial setup
  • Loading branch information
nlourie authored Sep 11, 2024
2 parents a667aab + 82a0300 commit 5c68816
Show file tree
Hide file tree
Showing 22 changed files with 36,461 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# .github/workflows/ci.yml
name: CI Workflow

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v2

# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.12

# Install Poetry
- name: Install Poetry
run: |
pip install poetry
# Install dependencies using Poetry
- name: Install dependencies
run: |
poetry install
# Lint the code using pylint
- name: Lint with pylint
run: |
poetry run pylint src
# Run Ruff for fast linting
- name: Run Ruff
run: |
poetry run ruff .
# Format code with Black
- name: Format with Black
run: |
poetry run black --check .
# Run tests with pytest
- name: Run tests
run: |
poetry run pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ __pycache__/
*.py[cod]
*$py.class

# Mac files
.DS_Store

# C extensions
*.so

Expand Down
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
repos:
# Pre-commit hooks for basic checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-yaml
- id: end-of-file-fixer

- repo: local
hooks:
- id: black
name: black
description: Run black to format code
entry: black # or should it be poetry run black
language: python
types: [python]


# Pylint as a local hook
- repo: local
hooks:
- id: pylint
name: pylint [full]
entry: pylint
language: system
types: [python]
args:
[
"--exit-zero"
]
verbose: true

# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
hooks:
- id: ruff
- id: ruff-format

# Poetry check as a local hook
- repo: local
hooks:
- id: poetry-check
name: poetry-check
description: run poetry check to validate config
entry: poetry check
language: python
pass_filenames: false
files: ^pyproject.toml$
language_version: python3.12
5 changes: 5 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[MASTER]
ignore=venv,docs

[MESSAGES CONTROL]
disable=C0114,C0115,C0116
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,20 @@
# image-daemon
image handling daemon for focus


## Installation
set up a new conda environment: `conda create -n image-daemon python=3.12`

then clone the repository:

```shell
git clone [email protected]:winter-telescope/image-daemon.git
cd image-daemon
```

this project uses poetry to manage the packages. Set it up this way:

```shell
conda install poetry -c conda-forge`
poetry install
```
Binary file added data/test/master_bias.fits
Binary file not shown.
33,340 changes: 33,340 additions & 0 deletions data/test/test_full_mef.fits

Large diffs are not rendered by default.

709 changes: 709 additions & 0 deletions data/test/test_pa_pb_pc_mef.fits

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
33 changes: 33 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import os
import sys

sys.path.insert(0, os.path.abspath("../src"))

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "image-daemon"
copyright = "2024, Nate Lourie"
author = "Nate Lourie"
release = "0.0.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
"sphinx.ext.autodoc",
]
templates_path = ["_templates"]
exclude_patterns = []


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
29 changes: 29 additions & 0 deletions docs/source/image_daemon.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
image\_daemon package
=====================

Subpackages
-----------

.. toctree::
:maxdepth: 4

image_daemon.utils

Submodules
----------

image\_daemon.paths module
--------------------------

.. automodule:: image_daemon.paths
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: image_daemon
:members:
:undoc-members:
:show-inheritance:
21 changes: 21 additions & 0 deletions docs/source/image_daemon.utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
image\_daemon.utils package
===========================

Submodules
----------

image\_daemon.utils.winter\_image module
----------------------------------------

.. automodule:: image_daemon.utils.winter_image
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: image_daemon.utils
:members:
:undoc-members:
:show-inheritance:
22 changes: 22 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. image-daemon documentation master file, created by
sphinx-quickstart on Tue Sep 10 15:07:09 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to image-daemon's documentation!
========================================

.. toctree::
:maxdepth: 4
:caption: Contents:

modules



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
src
===

.. toctree::
:maxdepth: 4

image_daemon
17 changes: 17 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: my_project_env
channels:
- defaults
- conda-forge
dependencies:
- python=3.12
- numpy <2
- pandas
- pip
- pip:
- -e . # Install your package in editable mode
- pytest
- black
- pylint
- ruff
- pyro5
- slack_sdk
Loading

0 comments on commit 5c68816

Please sign in to comment.