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

Maint giles #17

Merged
merged 11 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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 .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
submodules: false
coverage: codecov
toxdeps: tox-pypi-filter
posargs: -n auto
posargs:
envs: |
- windows: py311
- macos: py310
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Reference
Software and API.

.. automodapi:: smart
.. automodapi:: smart.map_processing
.. automodapi:: smart.processing
.. automodapi:: smart.differential_rotation
.. automodapi:: smart.indexed_grown_mask
.. automodapi:: smart.calculate_properties
Expand Down
8 changes: 5 additions & 3 deletions examples/full_walkthrough.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,18 @@
from smart.calculate_properties import dB_dt, get_properties, smart_indentify_and_characterize
from smart.differential_rotation import diff_rotation
from smart.indexed_grown_mask import index_and_grow_mask
from smart.map_processing import smart_prep
from smart.processing import smart_prep

#####################################################
#

hmi_map = Map(
"https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_230000_TAI.3.magnetogram.fits"
"http://jsoc.stanford.edu/data/hmi/fits/2024/06/06/hmi.M_720s.20240606_230000_TAI.fits"
# "https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_230000_TAI.3.magnetogram.fits"
)
hmi_map_prev = Map(
"https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_000000_TAI.3.magnetogram.fits"
"http://jsoc.stanford.edu/data/hmi/fits/2024/06/06/hmi.M_720s.20240606_000000_TAI.fits"
# "https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_000000_TAI.3.magnetogram.fits"
)

threshold_map, cos_correction = smart_prep(hmi_map)
Expand Down
18 changes: 9 additions & 9 deletions examples/smart_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from smart.calculate_properties import cosine_weighted_area_map, dB_dt, extract_features, get_properties
from smart.differential_rotation import diff_rotation
from smart.indexed_grown_mask import index_and_grow_mask, plot_indexed_grown_mask
from smart.map_processing import (
from smart.processing import (
calculate_cosine_correction,
cosine_correct_data,
map_threshold,
Expand All @@ -31,10 +31,10 @@
#
# We start by creating a sunpy.Map from our .fits file.

# hmi_map = Map("http://jsoc.stanford.edu/data/hmi/fits/2024/06/06/hmi.M_720s.20240606_230000_TAI.fits")
hmi_map = Map(
"https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_230000_TAI.3.magnetogram.fits"
)
hmi_map = Map("http://jsoc.stanford.edu/data/hmi/fits/2024/06/06/hmi.M_720s.20240606_230000_TAI.fits")
# hmi_map = Map(
# "https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_230000_TAI.3.magnetogram.fits"
# )

#####################################################
# We'll also plot this map to see how it looks before applying any of the SMART processes.
Expand Down Expand Up @@ -64,10 +64,10 @@
# This time we'll simply use the `~smart.map_processing.smart_prep` function to create our thresholded map and calculate the corrected data. This function performs the
# `~smart.map_processing.smooth_los_threshold`, `~smart.map_processing.calculate_cosine_correction`, and `~smart.map_processing.cosine_correct_data` functions.

# hmi_map_prev = Map("http://jsoc.stanford.edu/data/hmi/fits/2024/06/05/hmi.M_720s.20240605_230000_TAI.fits")
hmi_map_prev = Map(
"https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_000000_TAI.3.magnetogram.fits"
)
hmi_map_prev = Map("http://jsoc.stanford.edu/data/hmi/fits/2024/06/06/hmi.M_720s.20240606_000000_TAI.fits")
# hmi_map_prev = Map(
# "https://solmon.dias.ie/data/2024/06/06/HMI/fits/hmi.m_720s_nrt.20240606_000000_TAI.3.magnetogram.fits"
# )
thresholded_map_prev, cos_correction_prev = smart_prep(hmi_map_prev)

#####################################################
Expand Down
63 changes: 59 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ requires-python = ">=3.9"
readme = { file = "README.rst", content-type = "text/x-rst" }
license = { file = "licenses/LICENSE.rst", content-type = "text/plain" }
dependencies = [
"numpy",
"sunpy[map]",
"scikit-image",
"matplotlib"
"sunpy[map]>=5.1",
"scikit-image>=0.24"
]
dynamic = ["version"]

Expand Down Expand Up @@ -45,5 +43,62 @@ exclude = ["smart._dev*"]
[tool.setuptools_scm]
write_to = "smart/_version.py"

[tool.gilesbot]
[tool.gilesbot.pull_requests]
enabled = true

[tool.gilesbot.towncrier_changelog]
enabled = true
verify_pr_number = true
changelog_skip_label = "No Changelog Entry Needed"
help_url = "https://github.com/TCDSolar/SMARTpy/blob/main/changelog/README.rst"

changelog_missing_long = "There isn't a changelog file in this pull request. Please add a changelog file to the `changelog/` directory following the instructions in the changelog [README](https://github.com/TCDSolar/SMARTpy/blob/main/changelog/README.rst)."

type_incorrect_long = "The changelog file you added is not one of the allowed types. Please use one of the types described in the changelog [README](https://github.com/TCDSolar/SMARTpy/blob/main/changelog/README.rst)"

number_incorrect_long = "The number in the changelog file you added does not match the number of this pull request. Please rename the file."

[tool.towncrier]
package = "smart"
filename = "CHANGELOG.rst"
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/TCDSolar/SMARTpy/pull/{issue}>`__"

[[tool.towncrier.type]]
directory = "breaking"
name = "Backwards Incompatible Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "api"
name = "API Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "removal"
name = "Deprecations and Removals"
showcontent = true

[[tool.towncrier.type]]
directory = "feature"
name = "Features"
showcontent = true

[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
name = "Improved Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "trivial"
name = "Trivial/Internal Changes"
showcontent = true

[tool.mypy]
python_version = "3.9"
118 changes: 0 additions & 118 deletions smart/IGM.py

This file was deleted.

2 changes: 1 addition & 1 deletion smart/calculate_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from smart.differential_rotation import diff_rotation
from smart.indexed_grown_mask import index_and_grow_mask
from smart.map_processing import calculate_cosine_correction, smart_prep
from smart.processing import calculate_cosine_correction, smart_prep

__all__ = ["cosine_weighted_area_map", "extract_features", "dB_dt", "get_properties"]

Expand Down
Loading