Skip to content

Commit

Permalink
Add effective area and temperature response (#33)
Browse files Browse the repository at this point in the history
* Adding new filter naming method.

* Creating effective area preparatory code.

* Update channel.py

* Add channel test

* Adding temperature response

* Add data files for testing

* Adding CHIANTI geny data file

* Adding temperature response testing

* Adding util

* Deleting data

* Updating __init__.py

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Delete un-used code.

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Made clarification to the testing script of the temperature response function.

* Cleared testing method for time script. Will update at a later time.

* A script for XRT date and time conversion to datetime objects.

* Creating a function to resolve filter name format inserted by user.

* Creating a observation date setter.

* Importing sunpy.time.

* Importing datetime

* Testing new mission date method.

* Correction to epoch.

* Minor changes to methods of problem solving.

* New script that only outputs the effective area.

* Test script for the new effective area script.

* Detail code review of the new effective area script.

* Add new effective area script and its corresponding attributes.

* Naming correction

* Corrections to import functions.

* Removed used effective area code.

* Updatig naming conventions.

* Testing edits.

* Updating effective area testing.

* Update temperature response testing functions.

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Clearing from used code.

* Updated effective area.

* Updated temperature response.

* Updated testing for channel.py.

* Updated testing for the effective area.

* Updated the CHIANTI file.

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/util/__init__ .py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/util/time.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Updating code methods.

* Clearing up code methods.

* Adding book reference.

* Cleaning up repeated code.

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Cleaning up code.

* Updating ccd contam file.

* New updated temperature response IDL testing files.

* Updating testing methods.

* Updated testing for new IDL testing files.

* Updated test channel.

* Cleaned up channel code.

* Updated effective area testing.

* Updated effective area code.

* Reviewed with small updates.

* Deleting un-used temperature response IDL text testing files.

* Fixing spelling errors.

* Applied per-commit edits.

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Converting string to f strings.

* Converting string to f strings.

* Updating geny files paths

* Updated geny file path

* Corrected imported functions

* Removing all code in test_time, not in use.

* Removed un-used function.

* Updated calling functions.

* Trying to fix failing issue.

* Trying to fix failing issue.

* Updated init file.

* Add empty list.

* Add empty list.

* Updated folder name

* Updated testing data path.

* Rename __init__.py to remove extra space

* Run pre-commit on all files

* Remove duplicate label

* Change formatting of codespell config

* Skip test collection in effective_area.py and temperature_response.py

Right now we're getting a weird error associated with test collection
for these two files, but I suspect it's not a problem with xrtpy itself.
I'm setting these two files to be ignored in pytest, and plan on
creating an issue for it.

* Apply pytest options

* Add pytest-allclose to test requirements

* Make Python tests {3.8, 3.9, 3.10} all be run at the same time

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/temperature_response.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/util/time.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Update xrtpy/response/effective_area.py

Co-authored-by: Nick Murphy <[email protected]>

* Added a doc string to a function.

* Added descriptions to the existing doc string.

* Update xrtpy/response/channel.py

Co-authored-by: Nick Murphy <[email protected]>

* Updated a for loop into an array.

* Updated code.

* Updated code.

Co-authored-by: Nick Murphy <[email protected]>
  • Loading branch information
joyvelasquez and namurphy authored Jun 17, 2022
1 parent 7657bb0 commit 77aea73
Show file tree
Hide file tree
Showing 193 changed files with 437,290 additions and 641 deletions.
51 changes: 10 additions & 41 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ jobs:
matrix:
include:

- name: Python 3.8 (Windows)
os: windows-latest
python: 3.8
noxenv: tests-3.8

- name: Python 3.9 (MacOS X)
os: ubuntu-latest
python: 3.9
noxenv: tests-3.9

- name: Python 3.10
noxenv: tests-3.10
noxposargs: --durations=10
Expand Down Expand Up @@ -50,47 +60,6 @@ jobs:
- name: ${{ matrix.name }}
run: nox -s ${{ matrix.noxenv }} -- ${{ matrix.noxposargs }}

comprehensive-tests:

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
needs: initial-tests
if: github.event.pull_request.draft == false

strategy:
fail-fast: false

matrix:
include:

- name: Python 3.8 (Windows)
os: windows-latest
python: 3.8
noxenv: tests-3.8

- name: Python 3.9 (MacOS X)
os: ubuntu-latest
python: 3.9
noxenv: tests-3.9

steps:

- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

- name: Install nox
run: python -m pip install --progress-bar off --upgrade nox

- name: ${{ matrix.name }}
run: nox -s ${{ matrix.noxenv }} -- ${{ matrix.noxposargs }}

documentation:

name: Documentation
Expand Down
2 changes: 0 additions & 2 deletions docs/contributing/data_from_idl.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
.. _release guide:

********************************
Updating Data from SolarSoft IDL
********************************
Expand Down
8 changes: 7 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
sphinx_no_notebooks = ["-D", "nbsphinx_execute=never"]
sphinx_nitpicky = ["-n"]

pytest_options = [
"--ignore",
"xrtpy/response/effective_area.py",
"--ignore",
"xrtpy/response/temperature_response.py",
]

@nox.session(python=python_versions)
def tests(session):
session.install("-r", "requirements/tests.txt")
session.install(".")
session.run("pytest")
session.run("pytest", *pytest_options)


@nox.session
Expand Down
1 change: 1 addition & 0 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ flake8-rst-docstrings
flake8-use-fstring
pydocstyle
pytest >= 5.4.0
pytest-allclose
pytest-xdist
13 changes: 2 additions & 11 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ tests =
flake8-use-fstring
pydocstyle
pytest >= 5.4.0
pytest-allclose
pytest-xdist
docs =
# ought to mirror requirements/docs.txt
Expand Down Expand Up @@ -223,17 +224,7 @@ exclude_lines =

[codespell]

skip =
*.genx,
*.geny,
*.png,
*egg*,
.git,
.hypothesis,
.nox,
.tox,
__pycache__,
_build
skip = *.genx,*.geny,*.png,*egg*,.git,.hypothesis,.nox,.tox,__pycache__,_build

# Occasionally codespell will have false positives. Put words here that
# should be ignored when codespell checks spellings.
Expand Down
4 changes: 2 additions & 2 deletions xrtpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

import warnings

from . import response
from xrtpy import response

try:
from .version import __version__
from xrtpy.version import __version__
except (ImportError, ModuleNotFoundError):
warnings.warn("version not found.")

Expand Down
18 changes: 16 additions & 2 deletions xrtpy/response/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
"""Response analysis for Hinode/XRT"""

from . import channel
from .channel import Geometry, EntranceFilter, Mirror, Filter, CCD, Channel, resolve_filter_name
from xrtpy.response import channel, effective_area, temperature_response
from xrtpy.response.channel import (
CCD,
Channel,
EntranceFilter,
Filter,
Geometry,
Mirror,
resolve_filter_name,
)
from xrtpy.response.effective_area import EffectiveAreaFundamental
from xrtpy.response.temperature_response import TemperatureResponseFundamental

__all__ = [
"channel",
Expand All @@ -12,4 +22,8 @@
"CCD",
"Channel",
"resolve_filter_name",
"EffectiveAreaFundamental",
"effective_area",
"temperature_response",
"TemperatureResponseFundamental",
]
Loading

0 comments on commit 77aea73

Please sign in to comment.