Skip to content

Commit ddd8e82

Browse files
committed
Rebase
1 parent 09a6b4a commit ddd8e82

File tree

15 files changed

+33
-25
lines changed

15 files changed

+33
-25
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ trim_trailing_whitespace=true
1212
indent_style=space
1313
indent_size=4
1414

15-
[*.yml]
15+
[{*.yml,*.toml}]
1616
indent_style=space
1717
indent_size=2

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: CI
22

33
on:
44
push:
5-
# branches:
6-
# - 'main'
7-
# - '*.*'
8-
# - '!*backport*'
9-
# tags:
10-
# - 'v*'
11-
# - '!*dev*'
12-
# - '!*pre*'
13-
# - '!*post*'
5+
branches:
6+
- 'main'
7+
- '*.*'
8+
- '!*backport*'
9+
tags:
10+
- 'v*'
11+
- '!*dev*'
12+
- '!*pre*'
13+
- '!*post*'
1414
pull_request:
1515
# Allow manual runs through the web UI
1616
workflow_dispatch:

changelog/83.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add a basic visibility forward fitting method (`xrayvision.vis_forward_fit.forward_fit.vis_forward_fit`).

examples/rhessi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
======================================
55
66
Create images from RHESSI visibility data
7+
78
"""
89

910
import astropy.units as apu

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ dependencies = [
2121
"packaging>=23.0",
2222
"scipy>=1.13",
2323
"xarray>=2023.5.0",
24-
"pymoo>=0.6.1.3"
2524
]
2625
dynamic = ["version"]
2726
keywords = ["solar", "physics", "solar", "sun", "x-rays"]
@@ -43,7 +42,10 @@ classifiers = [
4342
map = [
4443
"sunpy[map]>=5.1.0"
4544
]
46-
all = ["xrayvisim[map]"]
45+
pso = [
46+
"pymoo>=0.6.1.3"
47+
]
48+
all = ["xrayvisim[map,pso]"]
4749
tests = [
4850
"matplotlib>=3.8.0",
4951
"pytest-astropy>=0.11.0",

ruff.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ exclude = [
88
]
99

1010
[lint]
11-
select = ["E", "F", "W", "UP", "PT"]
11+
select = ["E", "F", "W", "UP", "PT", "C"]
1212
extend-ignore = [
1313
# pycodestyle (E, W)
1414
"E501", # LineTooLong # TODO! fix
@@ -27,7 +27,12 @@ extend-ignore = [
2727
"docs/conf.py" = ["E402"]
2828
"docs/*.py" = [
2929
"INP001", # Implicit-namespace-package. The examples are not a package.
30+
"D100"
3031
]
32+
"examples/*.py" = [
33+
"D"
34+
]
35+
3136
"__init__.py" = ["E402", "F401", "F403"]
3237
"test_*.py" = ["B011", "D", "E402", "PGH001", "S101"]
3338
# Need to import clients to register them, but don't use them in file

xrayvision/clean.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ def vis_clean(
198198
map :
199199
Return a `sunpy.map.Map` by default or array only if `False`
200200
"""
201-
202201
dirty_map = vis_to_map(vis, shape=shape, pixel_size=pixel_size, **kwargs)
203202
dirty_beam_shape = [x.value * 3 + 1 if x.value * 3 % 2 == 0 else x.value * 3 for x in shape] * shape.unit
204203
dirty_beam = vis_psf_image(vis, shape=dirty_beam_shape, pixel_size=pixel_size, **kwargs)

xrayvision/coordinates/frames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def projective_wcs_to_frame(wcs):
7171
observer = None
7272
for frame, attr_names in required_attrs.items():
7373
attrs = [getattr(wcs.wcs.aux, attr_name) for attr_name in attr_names]
74-
if all([attr is not None for attr in attrs]):
74+
if all(attr is not None for attr in attrs):
7575
kwargs = {"obstime": dateavg}
7676
if rsun is not None:
7777
kwargs["rsun"] = rsun

xrayvision/mem.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ def _estimate_flux(vis, shape, pixel, maxiter=1000, tol=1e-3):
133133
Estimated total flux
134134
135135
"""
136-
137136
Hv, Lip, Visib = _prepare_for_optimise(pixel, shape, vis)
138137

139138
# PROJECTED LANDWEBER
@@ -237,7 +236,6 @@ def _get_mean_visibilities(vis, shape, pixel):
237236
-------
238237
Mean Visibilities
239238
"""
240-
241239
if vis.amplitude_uncertainty is None:
242240
amplitude_uncertainty = np.ones_like(vis.visibilities)
243241
else:
@@ -374,7 +372,6 @@ def _proximal_operator(z, f, m, lamb, Lip, niter=250):
374372
-------
375373
376374
"""
377-
378375
# INITIALIZATION OF THE DYKSTRA - LIKE SPLITTING
379376
x = z[:]
380377
p = np.zeros_like(x)
@@ -434,11 +431,11 @@ def _optimise_fb(Hv, Visib, Lip, flux, lambd, shape, pixel, maxiter, tol):
434431
Maximum number of iterations
435432
tol :
436433
Tolerance value used in the stopping rule ( || x - x_old || <= tol || x_old ||)
434+
437435
Returns
438436
-------
439437
MEM Image
440438
"""
441-
442439
# 'f': value of the total flux of the image (taking into account the area of the pixel)
443440
f = flux / (pixel[0] * pixel[1])
444441
# 'm': total flux divided by the number of pixels of the image

xrayvision/tests/test_visibility.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_vis_eq(visibilities):
109109
def test_meta_eq(vis_meta):
110110
meta = vis_meta
111111
assert meta == meta
112-
meta = vm.VisMeta(dict())
112+
meta = vm.VisMeta({})
113113
assert meta == meta
114114

115115

0 commit comments

Comments
 (0)