Skip to content

Commit

Permalink
#94 Merge pull request from deshima-dev/astropenguin/issue93
Browse files Browse the repository at this point in the history
Update project dependencies
  • Loading branch information
astropenguin authored Dec 11, 2024
2 parents 164f221 + c251ca1 commit 5e5a2f6
Show file tree
Hide file tree
Showing 27 changed files with 2,818 additions and 1,637 deletions.
39 changes: 39 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "deshima-sensitivity",
"image":"python:3.11",
"features": {
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "1.8.3"
}
},
"containerEnv": {
"POETRY_VIRTUALENVS_CREATE": "false"
},
"runArgs": [
"--name=deshima-sensitivity"
],
"postCreateCommand": "poetry install",
"customizations": {
"vscode": {
"extensions": [
"github.vscode-pull-request-github",
"mhutchie.git-graph",
"ms-python.black-formatter",
"ms-python.python",
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml"
],
"settings": {
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"python.languageServer": "Pylance"
}
}
}
}
}
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

29 changes: 12 additions & 17 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,25 @@ on:
release:
types:
- created
- edited
workflow_dispatch:

jobs:
job:
name: GitHub Pages
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: false
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: |
sudo apt install pandoc
pip install poetry
poetry install
- name: Build docs
run: poetry run etc/builddocs
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
python-version: "3.12"
- uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.3"
- run: poetry install
- run: docs/build
- uses: peaceiris/actions-gh-pages@v3
with:
force_orphan: true
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build
publish_branch: gh-pages
force_orphan: true
22 changes: 9 additions & 13 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@ on:
- created

jobs:
publish:
job:
name: PyPI
runs-on: ubuntu-latest
env:
USERNAME: ${{ secrets.PYPI_USERNAME }}
PASSWORD: ${{ secrets.PYPI_PASSWORD }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies
run: pip install poetry
- name: Publish package
run: |
poetry build
poetry publish --username $USERNAME --password $PASSWORD
python-version: "3.12"
- uses: abatilo/actions-poetry@v3
with:
poetry-version: "1.8.3"
- run: poetry publish --build
48 changes: 24 additions & 24 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
name: Tests

on:
push:
branches:
- main
- deshima2.0
pull_request:
branches:
- master
- develop
- main
- deshima2.0

jobs:
test:
name: Test (Python ${{ matrix.python-version }})
job:
name: Test (Python ${{ matrix.python }})
runs-on: ubuntu-latest
env:
POETRY_VIRTUALENVS_CREATE: false
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
env:
TESTED_DIRS: deshima_sensitivity docs tests
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: abatilo/actions-poetry@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt install pandoc
pip install poetry
poetry install
- name: Test code format (Black)
run: poetry run black --check ${TESTED_DIRS}
- name: Test code style (Flake8)
run: poetry run flake8 ${TESTED_DIRS}
- name: Test package (pytest)
run: poetry run pytest -v tests
- name: Test docs building (Sphinx)
run: poetry run etc/builddocs
poetry-version: "1.8.3"
- run: poetry install
- run: black --check decode docs tests
- run: pytest -v tests
- run: docs/build
52 changes: 40 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# User-defined
.vscode/settings.json
examples/D1.csv
examples/D2baseline.csv
examples/D2goal.csv
# Created by https://www.toptal.com/developers/gitignore/api/python
# Edit at https://www.toptal.com/developers/gitignore?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -26,7 +24,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -76,14 +73,11 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/readme.rst
docs/_apidoc
docs/_source
docs/make.bat
docs/Makefile
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -105,7 +99,22 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -147,3 +156,22 @@ dmypy.json

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python
31 changes: 0 additions & 31 deletions .zenodo.json

This file was deleted.

19 changes: 19 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."

title: "deshima-sensitivity"
abstract: "Sensitivity calculator for DESHIMA-type spectrometers"
version: 0.3.1
date-released: 2024-12-11
license: "MIT"
doi: "10.5281/zenodo.3966839"
url: "https://github.com/deshima-dev/deshima-sensitivity"
authors:
- given-names: "Akira"
family-names: "Endo"
affiliation: "Delft University of Technology"
orcid: "https://orcid.org/0000-0003-0379-2341"
- given-names: "Akio"
family-names: "Taniguchi"
affiliation: "Kitami Institute of Technology"
orcid: "https://orcid.org/0000-0002-9695-6183"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 DESHIMA software team
Copyright (c) 2020-2024 DESHIMA Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# deshima-sensitivity

[![PyPI](https://img.shields.io/pypi/v/deshima-sensitivity.svg?label=PyPI&style=flat-square)](https://pypi.org/pypi/deshima-sensitivity/)
[![Python](https://img.shields.io/pypi/pyversions/deshima-sensitivity.svg?label=Python&color=yellow&style=flat-square)](https://pypi.org/pypi/deshima-sensitivity/)
[![Test](https://img.shields.io/github/workflow/status/deshima-dev/deshima-sensitivity/Test?logo=github&label=Test&style=flat-square)](https://github.com/deshima-dev/deshima-sensitivity/actions)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?label=License&style=flat-square)](LICENSE)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.3966839-blue?style=flat-square)](https://doi.org/10.5281/zenodo.3966839)
[![Release](https://img.shields.io/pypi/v/deshima-sensitivity?label=Release&color=cornflowerblue&style=flat-square)](https://pypi.org/project/deshima-sensitivity/)
[![Python](https://img.shields.io/pypi/pyversions/deshima-sensitivity?label=Python&color=cornflowerblue&style=flat-square)](https://pypi.org/project/deshima-sensitivity/)
[![Downloads](https://img.shields.io/pypi/dm/deshima-sensitivity?label=Downloads&color=cornflowerblue&style=flat-square)](https://pepy.tech/project/deshima-sensitivity)
[![DOI](https://img.shields.io/badge/DOI-10.5281/zenodo.3966839-cornflowerblue?style=flat-square)](https://doi.org/10.5281/zenodo.3966839)
[![Tests](https://img.shields.io/github/actions/workflow/status/deshima-dev/deshima-sensitivity/tests.yaml?label=Tests&style=flat-square)](https://github.com/deshima-dev/deshima-sensitivity/actions)

Sensitivity calculator for DESHIMA-type spectrometers

Expand All @@ -28,11 +28,11 @@ In the case of running it in a local Python environment, please follow the requi

## Requirements

- **Python:** 3.7, 3.8, or 3.9 (tested by the authors)
- **Dependencies:** See [pyproject.toml](https://github.com/deshima-dev/deshima-sensitivity/blob/master/pyproject.toml)
- **Python:** 3.10, 3.11, 3.12, and 3.13 (tested by the authors)
- **Dependencies:** See [pyproject.toml](https://github.com/deshima-dev/deshima-sensitivity/blob/v0.3.1/pyproject.toml)

## Installation

```shell
$ pip install deshima-sensitivity
pip install deshima-sensitivity
```
25 changes: 0 additions & 25 deletions configure

This file was deleted.

1 change: 1 addition & 0 deletions deshima_sensitivity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
but the power (in transmission) couples to the sky.
"""

# flake8: noqa
__version__ = "0.3.1"

Expand Down
4 changes: 2 additions & 2 deletions deshima_sensitivity/atmosphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def eta_atm_func(
Atmospheric tranmsmission. Units: None.
"""
if np.average(F) > 10.0 ** 9:
F = F / 10.0 ** 9
if np.average(F) > 10.0**9:
F = F / 10.0**9

# give F a length if it is an integer.
if not hasattr(F, "__len__"):
Expand Down
Loading

0 comments on commit 5e5a2f6

Please sign in to comment.