Skip to content

Commit

Permalink
Merge pull request #120 from cds-astro/add-EllipticalFrame-to-some-ex…
Browse files Browse the repository at this point in the history
…amples

Add elliptical frame to most examples with allsky plots
  • Loading branch information
ManonMarchand authored Dec 4, 2023
2 parents 364618d + 43a44f8 commit 1facb81
Show file tree
Hide file tree
Showing 12 changed files with 610 additions and 84,170 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ repos:
- id: black
# Fast linter to replace flake8
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.5'
rev: 'v0.1.6'
hooks:
- id: ruff
fail_fast: true
# Same tools but for Jupyter notebooks
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
rev: 1.7.1
hooks:
- id: nbqa-black
name: nbqa-black
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/polygon_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import matplotlib.pyplot as plt
import numpy as np
from astropy.coordinates import Angle, SkyCoord

from mocpy import MOC, WCS

# The set of points delimiting the polygon in deg
Expand Down Expand Up @@ -34,7 +33,7 @@
# A point that we say it belongs to the inside of the MOC
inside = SkyCoord(ra=10, dec=5, unit="deg", frame="icrs")
moc = MOC.from_polygon_skycoord(skycoord, max_depth=9)
moc.write("polygon_moc.fits", format="fits", overwrite=True)
moc.save("polygon_moc.fits", format="fits", overwrite=True)

# Plot the MOC using matplotlib
fig = plt.figure(111, figsize=(10, 10))
Expand Down
84,001 changes: 34 additions & 83,967 deletions notebooks/00-MOCpy_introduction.ipynb

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions notebooks/FITS-image-pixels-intersecting-MOC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"metadata": {},
"outputs": [],
"source": [
"from astropy.io import fits\n",
"from astropy.wcs import WCS as WCS\n",
"from mocpy import MOC\n",
"from astropy.visualization import simple_norm\n",
"import astropy.units as u\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
"from astropy.io import fits\n",
"from astropy.visualization import simple_norm\n",
"from astropy.wcs import WCS\n",
"from mocpy import MOC"
]
},
{
Expand Down Expand Up @@ -206,7 +206,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.10 64-bit",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -220,7 +220,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
"version": "3.12.0"
},
"toc": {
"base_numbering": 1,
Expand All @@ -239,8 +239,15 @@
"interpreter": {
"hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1"
}
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
11 changes: 9 additions & 2 deletions notebooks/First_Steps_with_FMOCs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
"# but we can change it to linear if needed\n",
"ax.set(xscale=\"linear\")\n",
"# and any customization on the ax of fig objects will work too\n",
"ax.spines[[\"left\", \"top\", \"right\"]].set_visible(False) # noqa: FBT003"
"ax.spines[[\"left\", \"top\", \"right\"]].set_visible(False)"
]
},
{
Expand Down Expand Up @@ -563,7 +563,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "mocpy-tests",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -578,6 +578,13 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"state": {},
"version_major": 2,
"version_minor": 0
}
}
},
"nbformat": 4,
Expand Down
24 changes: 16 additions & 8 deletions notebooks/STMOC from time ranges.ipynb

Large diffs are not rendered by default.

57 changes: 26 additions & 31 deletions notebooks/compute_moc_borders.ipynb

Large diffs are not rendered by default.

451 changes: 362 additions & 89 deletions notebooks/filtering_astropy_table.ipynb

Large diffs are not rendered by default.

86 changes: 71 additions & 15 deletions notebooks/from_astropy_table.ipynb

Large diffs are not rendered by default.

91 changes: 57 additions & 34 deletions notebooks/from_fits_and_intersection.ipynb

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions notebooks/from_polygon.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ locked = false
"python/mocpy/moc/plot/wcs.py" = ["B008"]
"python/mocpy/tests/*.py" = ["S101", "D103"] # S101: use of "assert" detected
"python/mocpy/serializer.py" = ["A002"] # Argument "format" is shadowing a python builtin
"notebooks/*.ipynb" = ["T201"] # print is okish in notebooks

[tool.nbqa.addopts]
ruff = ["--ignore=B018,FBT003"]
ruff = ["--ignore=B018,FBT003,T201"]

[tool.ruff]
fix = true
Expand Down

0 comments on commit 1facb81

Please sign in to comment.