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

Registers package with the sunpy packaging #115

Merged
merged 7 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion .ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extend-ignore = [
"examples/**.py" = [
"T201", # allow use of print in examples
]
"__init__.py" = ["E402", "F401", "F403"]
"__init__.py" = ["E402", "F401", "F403", "F405"]
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]

[lint.pydocstyle]
Expand Down
4 changes: 2 additions & 2 deletions radiospectra/net/sources/ecallisto.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class eCALLISTOClient(GenericClient):
"""
Provides access to `eCallisto radio spectrometer <http://soleil80.cs.technik.fhnw.ch/solarradio/data/2002-20yy_Callisto/>`__
Provides access to `eCallisto radio spectrometer <http://soleil80.cs.technique.fhnw.ch/solarradio/data/2002-20yy_Callisto/>`__
`data archive <https://spdf.gsfc.nasa.gov>`__.

`Further information <http://www.e-callisto.org>`__.
Expand Down Expand Up @@ -40,7 +40,7 @@ class eCALLISTOClient(GenericClient):
"""

baseurl = (
r"http://soleil80.cs.technik.fhnw.ch/solarradio/data/2002-20yy_Callisto/"
r"http://soleil80.cs.technique.fhnw.ch/solarradio/data/2002-20yy_Callisto/"
r"%Y/%m/%d/{obs}_%Y%m%d_%H%M%S.*.fit.gz"
)
pattern = (
Expand Down
1 change: 1 addition & 0 deletions radiospectra/net/sources/ilofar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np

import astropy.units as u

from sunpy.net import attrs as a
from sunpy.net.dataretriever.client import GenericClient, QueryResponse
from sunpy.net.scraper import Scraper
Expand Down
1 change: 1 addition & 0 deletions radiospectra/net/sources/psp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import astropy.units as u

from sunpy.net import attrs as a
from sunpy.net.dataretriever.client import GenericClient, QueryResponse
from sunpy.net.scraper import Scraper
Expand Down
2 changes: 1 addition & 1 deletion radiospectra/net/sources/tests/data/rstn_holloman.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<!-- BEGIN HEADER -->
<div id="left_image" style="width:440; postion:absolute; left:0px; top:0px;">
<div id="left_image" style="width:440; position:absolute; left:0px; top:0px;">
<a href="https://www.ngdc.noaa.gov/ngdc.html" target="_top" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home"><img src="https://www.ngdc.noaa.gov/image/nesdisngdcleft.gif" alt="Logo" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home" border="0" width="440" height="50"></a>
</div>
<div id="right_image" style="width:121; position:absolute; right:0px; top:0px">
Expand Down
2 changes: 1 addition & 1 deletion radiospectra/net/sources/tests/data/rstn_learmonth.html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably skip anything update /**/data/ or anything not a .py file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah excellent call, i'm assuming this is broken for a test?

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<!-- BEGIN HEADER -->
<div id="left_image" style="width:440; postion:absolute; left:0px; top:0px;">
<div id="left_image" style="width:440; position:absolute; left:0px; top:0px;">
<a href="https://www.ngdc.noaa.gov/ngdc.html" target="_top" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home"><img src="https://www.ngdc.noaa.gov/image/nesdisngdcleft.gif" alt="Logo" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home" border="0" width="440" height="50"></a>
</div>
<div id="right_image" style="width:121; position:absolute; right:0px; top:0px">
Expand Down
2 changes: 1 addition & 1 deletion radiospectra/net/sources/tests/data/rstn_san-vito.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<!-- BEGIN HEADER -->
<div id="left_image" style="width:440; postion:absolute; left:0px; top:0px;">
<div id="left_image" style="width:440; position:absolute; left:0px; top:0px;">
<a href="https://www.ngdc.noaa.gov/ngdc.html" target="_top" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home"><img src="https://www.ngdc.noaa.gov/image/nesdisngdcleft.gif" alt="Logo" title="go to NOAA National Centers for Environmental Information (formerly the National Geophysical Data Center) home" border="0" width="440" height="50"></a>
</div>
<div id="right_image" style="width:121; position:absolute; right:0px; top:0px">
Expand Down
4 changes: 2 additions & 2 deletions radiospectra/net/sources/tests/test_ecallisto_client.py
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess need to add 'technik' to the spell check list of words

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do that here, dw

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def test_client(urlopen, client, http_responses):
query = client.search(a.Time("2019/10/05 23:00", "2019/10/06 00:59"), a.Instrument("eCALLISTO"))
assert urlopen.call_count == 2
# 2nd call
urlopen.assert_called_with("http://soleil80.cs.technik.fhnw.ch/solarradio/data/2002-20yy_Callisto/2019/10/06/")
urlopen.assert_called_with("http://soleil80.cs.technique.fhnw.ch/solarradio/data/2002-20yy_Callisto/2019/10/06/")
assert len(query) == 156


Expand All @@ -68,7 +68,7 @@ def test_client_with_observatory(urlopen, client, http_responses):
)
assert urlopen.call_count == 2
# 2nd call
urlopen.assert_called_with("http://soleil80.cs.technik.fhnw.ch/solarradio/data/2002-20yy_Callisto/2019/10/06/")
urlopen.assert_called_with("http://soleil80.cs.technique.fhnw.ch/solarradio/data/2002-20yy_Callisto/2019/10/06/")
assert len(query) == 8


Expand Down
14 changes: 7 additions & 7 deletions radiospectra/spectrogram/sources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
from .waves import * # NOQA

__all__ = [
"SWAVESSpectrogram", # NOQA: F405
"RFSSpectrogram", # NOQA: F405
"CALISTOSpectrogram", # NOQA: F405
"EOVSASpectrogram", # NOQA: F405
"RSTNSpectrogram", # NOQA: F405
"RPWSpectrogram", # NOQA: F405
"ILOFARMode357Spectrogram", # NOQA: F405
"SWAVESSpectrogram",
"RFSSpectrogram",
"CALISTOSpectrogram",
"EOVSASpectrogram",
"RSTNSpectrogram",
"RPWSpectrogram",
"ILOFARMode357Spectrogram",
]
2 changes: 1 addition & 1 deletion radiospectra/spectrogram/sources/eovsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ def is_datasource_for(cls, data, meta, **kwargs):
return meta["instrument"] == "EOVSA" or meta["detector"] == "EOVSA"

# TODO fix time gaps for plots need to render them as gaps
# can prob do when generateing proper pcolormesh gird but then prob doesn't belong here
# can prob do when generateing proper pcolormesh grid but then prob doesn't belong here
1 change: 1 addition & 0 deletions radiospectra/spectrogram/sources/tests/test_callisto.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down
1 change: 1 addition & 0 deletions radiospectra/spectrogram/sources/tests/test_eovsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down
5 changes: 3 additions & 2 deletions radiospectra/spectrogram/sources/tests/test_psp_rfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down Expand Up @@ -111,7 +112,7 @@ def test_psp_rfs_lfr(parse_path_moc):
assert spec.observatory == "PSP"
assert spec.instrument == "FIELDS/RFS"
assert spec.detector == "LFR"
# TODO check why not exact prob base on spacecrast ET so won't match utc exacly
# TODO check why not exact prob base on spacecrast ET so won't match utc exactly
assert spec.start_time.datetime == datetime(2019, 4, 9, 0, 1, 16, 197889)
assert spec.end_time.datetime == datetime(2019, 4, 10, 0, 1, 4, 997573)
assert spec.wavelength.min.round(1) == 10.5 * u.kHz
Expand Down Expand Up @@ -219,7 +220,7 @@ def test_psp_rfs_hfr(parse_path_moc):
assert spec.observatory == "PSP"
assert spec.instrument == "FIELDS/RFS"
assert spec.detector == "HFR"
# TODO check why not exact prob base on spacecrast ET so won't match utc exacly
# TODO check why not exact prob base on spacecrast ET so won't match utc exactly
assert spec.start_time.datetime == datetime(2019, 4, 9, 0, 1, 13, 904188)
assert spec.end_time.datetime == datetime(2019, 4, 10, 0, 1, 2, 758315)
assert spec.wavelength.min == 1275.0 * u.kHz
Expand Down
1 change: 1 addition & 0 deletions radiospectra/spectrogram/sources/tests/test_rstn.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down
1 change: 1 addition & 0 deletions radiospectra/spectrogram/sources/tests/test_swaves.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down
1 change: 1 addition & 0 deletions radiospectra/spectrogram/sources/tests/test_waves.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import astropy.units as u
from astropy.time import Time

from sunpy.net import attrs as a

from radiospectra.spectrogram import Spectrogram
Expand Down
Loading