Skip to content

Commit

Permalink
Make minor updates to packaging and documentation (#87)
Browse files Browse the repository at this point in the history
* More consistently use XRTpy capitalization

* Fix missing OS in GitHub Action

* Add pre-commit hooks

* Apply pyupgrade updates
  • Loading branch information
namurphy authored Nov 25, 2022
1 parent 8edd466 commit 782ad54
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
noxenv: linters

- name: Import package
os: windows-latest
python: '3.11'
noxenv: import_package

steps:
Expand Down
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,16 @@ repos:
hooks:
- id: codespell
args: [--config pyproject.toml]

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
hooks:
- id: pyupgrade
args: [--keep-runtime-typing, --py38-plus]
files: ^xrtpy/

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
hooks:
- id: rst-directive-colons
- id: rst-inline-touching-normal
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# xrtpy
# XRTpy

[![License](https://img.shields.io/badge/License-BSD%202--Clause-blue.svg)](./LICENSE)
[![GitHub Actions — CI](https://github.com/HinodeXRT/xrtpy/workflows/CI/badge.svg)](https://github.com/HinodeXRT/xrtpy/actions?query=workflow%3ACI+branch%3Amain)
[![Read the Docs Status](https://readthedocs.org/projects/xrtpy/badge/?version=latest&logo=twitter)](http://xrtpy.readthedocs.io/en/latest/?badge=latest)
[![astropy](http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat&logo=astropy)](http://www.astropy.org/)

`xrtpy` is a Python package being developed for the analysis of observations
made by the X-Ray Telescope (XRT) on the *Hinode* spacecraft.
XRTpy is a Python package being developed for the analysis of observations
made by the X-Ray Telescope (XRT) on the *Hinode* spacecraft.

## Acknowledgements

The development of xrtpy is supported by NASA contract NNM07AB07C to the
The development of XRTpy is supported by NASA contract NNM07AB07C to the
Smithsonian Astrophysical Observatory.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
XRTpy Documentation
###################

This is the documentation for `xrtpy`: a Python_ package being developed
This is the documentation for XRTpy: a Python_ package being developed
for the analysis of observations made by the `X-Ray Telescope`_ (XRT)
:cite:p:`golub:2007` on the Hinode_ spacecraft :cite:p:`kosugi:2007`.

Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ author_email = joy.velasquez@cfa.harvard.edu
license = BSD 2-clause
license_file = LICENSE
url = https://github.com/HinodeXRT/xrtpy
description = xrtpy is Python package for analyzing data from the X-Ray Telescope instrument onboard the Hinode spacecraft.
description = A Python package for analyzing data from the X-Ray Telescope instrument onboard the Hinode spacecraft.
long_description = file: README.md
edit_on_github = True
github_project =
Expand All @@ -21,6 +21,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython

[options]
Expand Down
2 changes: 1 addition & 1 deletion xrtpy/response/effective_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def n_DEHP_attributes(self):
"""Diethylhexylphthalate: Wavelength (nm), Delta, Beta."""
_n_DEHP_filename = Path(__file__).parent.absolute() / "data" / "n_DEHP.txt"

with open(_n_DEHP_filename, "r") as n_DEHP:
with open(_n_DEHP_filename) as n_DEHP:
list_of_DEHP_attributes = []
for line in n_DEHP:
stripped_line = line.strip()
Expand Down
4 changes: 2 additions & 2 deletions xrtpy/response/tests/test_effective_area.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_IDL_data_files():

def _IDL_raw_data_list(filename):

with open(filename, "r") as filter_file:
with open(filename) as filter_file:

list_of_IDL_effective_area_data = []
for line in filter_file:
Expand Down Expand Up @@ -146,7 +146,7 @@ def IDL_test_date(list_of_lists):

def _IDL_effective_area_raw_data(filename):

with open(filename, "r") as filter_file:
with open(filename) as filter_file:

list_of_lists = []
for line in filter_file:
Expand Down
4 changes: 2 additions & 2 deletions xrtpy/response/tests/test_temperature_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_IDL_data_files():

def _IDL_raw_data_list(filename):

with open(filename, "r") as filter_file:
with open(filename) as filter_file:

IDL_data_list = []
for line in filter_file:
Expand Down Expand Up @@ -57,7 +57,7 @@ def IDL_test_date(IDL_data_list):

def _IDL_temperature_response_raw_data(filename):

with open(filename, "r") as filter_file:
with open(filename) as filter_file:

IDL_data_list = []
for line in filter_file:
Expand Down

0 comments on commit 782ad54

Please sign in to comment.