Skip to content

Commit 21a7a52

Browse files
vatch123nabobalis
authored andcommitted
Occult 2 (#31)
* added helpers * Added skeleton of the occult * added return part * Added tests for helpers * Moved to test folder * Fixed the test * Added changelog * fixed pep8 * Changed Return typr * Major modifications, closer to IDL * Fixed zeroing out * Fixed reference * removed some bugs * Fixed the mean calculations * fixed background * negated smaller loops * added some docs * Tidy up of the code and other items. * added exact idl replica * sub functions * fixed occult * docs completed * few tests and examples * more tests * main test * fixed extra loop points * Apply suggestions from code review Co-Authored-By: Nabil Freij <nabil.freij@gmail.com> * tests complete * some fixes * vectorize attempt * Apply suggestions from code review Co-Authored-By: Nabil Freij <nabil.freij@gmail.com> * fixed unintended changes * Further fixes * vectorized * fixed hash * docs * test file reduced * ran linters * changed to online * fixing setup.cfg * updated tox.ini * fixed pyproject.toml * changed setup.py * fix things * circleci update * circleci update v2 * circleci update v3 * moved to utils * fixed pep8 * ran linters * fixed docs
1 parent fbf6a19 commit 21a7a52

26 files changed

+6428
-144
lines changed

.circleci/config.yml

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,24 @@ merge-check: &merge-check
1111
git checkout -qf pr/$CIRCLE_PR_NUMBER/merge
1212
fi
1313
14-
apt-run: &apt-install
15-
name: Install apt packages
16-
command: |
17-
sudo apt update
18-
sudo apt install -y graphviz
19-
2014
permission-run: &permission-run
2115
name: Fix permssions for installing
2216
command: |
2317
sudo chown -R circleci:circleci /usr/local/bin
2418
sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
2519
sudo chown -R circleci:circleci /usr/local/share/
2620
27-
tox-install: &tox-install
28-
name: Install Tox
21+
apt-run: &apt-install
22+
name: Install apt packages
2923
command: |
30-
pip install tox
24+
apt update
25+
apt install -y graphviz build-essential libopenjp2-7 git
3126
32-
tox-conda-install: &tox-conda-install
33-
name: Install Tox-Conda
27+
sudo-apt-run: &sudo-apt-install
28+
name: Install apt packages
3429
command: |
35-
pip install tox-conda
30+
sudo apt update
31+
sudo apt install -y graphviz build-essential libopenjp2-7 git
3632
3733
version: 2
3834
jobs:
@@ -54,24 +50,31 @@ jobs:
5450
- run: *merge-check
5551
- run: python setup.py egg_info
5652

53+
twine-check:
54+
docker:
55+
- image: circleci/python:3.7
56+
steps:
57+
- checkout
58+
- run: *skip-check
59+
- run: *merge-check
60+
- run: *permission-run
61+
- run: python setup.py sdist
62+
- run: python -m pip install -U --force-reinstall twine
63+
- run: python -m twine check dist/*
64+
5765
pip-install:
5866
docker:
5967
- image: circleci/python:3.7
6068
steps:
6169
- checkout
6270
- run: *skip-check
6371
- run: *merge-check
64-
- run: *apt-install
72+
- run: *sudo-apt-install
6573
- run: *permission-run
66-
- run:
67-
name: Update pip
68-
command: pip install -U pip
69-
- run:
70-
name: Install sunkit_image
71-
command: |
72-
pip install --progress-bar off .[all,dev]
73-
pip install --no-use-pep517 -e .[all,dev]
74-
python setup.py develop
74+
- run: pip install -U pip
75+
- run: pip install --progress-bar off .[all,dev]
76+
- run: pip install -e .[all,dev]
77+
- run: python setup.py develop
7578

7679
figure-tests-37:
7780
docker:
@@ -80,10 +83,9 @@ jobs:
8083
- checkout
8184
- run: *skip-check
8285
- run: *merge-check
83-
- run: *tox-install
84-
- run: *tox-conda-install
86+
- run: *apt-install
87+
- run: pip install -U tox tox-conda codecov
8588
- run: tox -e figure
86-
- run: pip install codecov
8789
- run: codecov
8890
- store_artifacts:
8991
path: figure_test_images
@@ -98,9 +100,9 @@ jobs:
98100
- checkout
99101
- run: *skip-check
100102
- run: *merge-check
101-
- run: *apt-install
102103
- run: *permission-run
103-
- run: *tox-install
104+
- run: *sudo-apt-install
105+
- run: pip install -U tox
104106
- run: tox -e build_docs
105107
- store_artifacts:
106108
path: docs/_build/html
@@ -117,14 +119,18 @@ workflows:
117119
- egg-info-36
118120
- egg-info-37
119121

120-
figure-tests:
122+
twine-check:
121123
jobs:
122-
- figure-tests-37
124+
- twine-check
123125

124126
pip-install:
125127
jobs:
126128
- pip-install
127129

130+
figure-tests:
131+
jobs:
132+
- figure-tests-37
133+
128134
test-documentation:
129135
jobs:
130136
- html-docs

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,4 @@ tags
220220

221221
# Release script
222222
.github_cache
223+
examples/loops.txt

azure-pipelines.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ jobs:
1313

1414
- template: azure-templates.yml
1515
parameters:
16-
name: macOS_37_offline
16+
name: macOS_37_online
1717
os: macos
18-
tox: py37-offline --
18+
tox: py37-online --
1919

2020
- template: azure-templates.yml
2121
parameters:
22-
name: Windows_36_offline
22+
name: Windows_36_online
2323
os: windows
24-
tox: py36-offline --
24+
tox: py36-online --
2525

2626
- template: azure-templates.yml
2727
parameters:

changelog/31.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added a new function (`sunkit_image.trace.occult2`) to automatically trace out loops/curved structures in an image.

docs/code_ref/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Code Reference
88
:maxdepth: 2
99

1010
sunkit_image
11+
enhance
1112
radial
13+
trace
1214
utils
13-
enhance

docs/code_ref/trace.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*****
2+
trace
3+
*****
4+
5+
This package implements tracing routines for solar physics data.
6+
7+
.. automodapi:: sunkit_image.trace

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import sys
33
import datetime
4+
45
# Get configuration information from setup.cfg
56
from configparser import ConfigParser
67

@@ -95,13 +96,17 @@
9596
"plot_gallery": True,
9697
}
9798

98-
# Write the latest changelog into the documentation.
99+
"""
100+
Write the latest changelog into the documentation.
101+
"""
99102
target_file = os.path.abspath("./whatsnew/latest_changelog.txt")
100103
try:
101104
from sunpy.util.towncrier import generate_changelog_for_docs
102105

103106
if is_development:
104107
generate_changelog_for_docs("../", target_file)
108+
else:
109+
open(target_file, "a").close()
105110
except Exception:
106111
# If we can't generate it, we need to make sure it exists or else sphinx
107112
# will complain.

examples/multiscale_gaussian_normalization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
import matplotlib.pyplot as plt
1212

13-
import sunpy.map
1413
import sunpy.data.sample
14+
import sunpy.map
1515

1616
import sunkit_image.enhance as enhance
1717

examples/radial_gradient_filters.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
import matplotlib.pyplot as plt
1212

1313
import astropy.units as u
14-
15-
import sunpy.map
1614
import sunpy.data.sample
15+
import sunpy.map
1716

1817
import sunkit_image.radial as radial
1918
from sunkit_image.utils import equally_spaced_bins

0 commit comments

Comments
 (0)