From 8ae124d85f12251526022478d9e6a409e12efb6d Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Wed, 1 May 2024 22:09:03 +0100 Subject: [PATCH] Fix coc and docs --- .pre-commit-config.yaml | 6 ++-- CODE_OF_CONDUCT.md | 46 +++++++++++++++++++++++++++++++ docs/conf.py | 4 ++- docs/known_issues.rst | 3 +- docs/reference/index.rst | 1 + docs/reference/io.rst | 7 +++++ docs/reference/sji.rst | 1 + docs/reference/spectrograph.rst | 1 + examples/README.txt | 8 +++--- examples/align_iris_aia_rolled.py | 2 +- irispy/_dev/scm_version.py | 2 +- 11 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 docs/reference/io.rst diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ed5837a..dbfdea2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ repos: - id: docformatter args: ["--in-place", "--pre-summary-newline", "--make-summary-multi"] - repo: https://github.com/myint/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake args: @@ -16,13 +16,13 @@ repos: ] exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$" - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: "v0.2.1" + rev: "v0.4.2" hooks: - id: ruff args: ["--fix", "--unsafe-fixes"] - id: ruff-format - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..d74b938 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Code of Conduct + +The Solar Physics community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. +It is through these differences that our community experiences success and continued growth. +We expect everyone in our community to follow these guidelines when interacting with others both inside and outside of our community. +Our goal is to keep ours a positive, inclusive, successful, and growing community. + +## Open + +Members of the community are open to collaboration, whether on patches, reporting issues, asking for help or otherwise. +We welcome those interested in joining the community, and realise that including people with a variety of opinions and backgrounds will only serve to enrich our community. + +We are accepting of all who wish to take part in our activities, fostering an environment where anyone can participate and everyone can make a difference, ensuring that all participants are heard and feel confident that they can freely express their opinions. + +## Considerate + +Members of the community are considerate of their peers -- other developers, users, etc. +We are thoughtful when addressing the efforts of others, keeping in mind that often the labour was completed simply for the good of the community. +We are attentive in our communications, whether in person or online, and we're tactful when approaching differing views. + +We recognize the work made by everyone and ensure the proper acknowledgement/citation of original authors at all times. +As authors, we pledge to be explicit about how we want our own work to be cited or acknowledged. + +## Respectful + +Members of the community are respectful. +We are respectful of others, their positions, their skills, their commitments, and their efforts. +We are respectful of the volunteer and professional efforts within the community. +We are respectful of the processes set forth in the community, and we work within them (paying particular attention to those new to the community). + +When we disagree, we are courteous in raising our issues. +We provide a harassment- and bullying-free environment, regardless of sex, sexual orientation, gender identity, disability, physical appearance, body size, race, nationality, ethnicity, and religion. +In particular, sexual language and imagery, sexist, racist, or otherwise exclusionary jokes are not appropriate. +We will treat those outside our community with the same respect as people within our community. + +Overall, we are good to each other and apply this code of conduct to all community situations online and offline, including mailing lists, forums, social media, conferences, meetings, associated social events, and one-to-one interactions. + +We pledge to help the entire community follow the code of conduct, and to not remain silent when we see violations of the code of conduct. + +Parts of this code of conduct have been adapted from the [astropy](https://www.astropy.org/code_of_conduct.html) and the [Python Software Foundation](https://www.python.org/psf/conduct/) codes of conduct. + +--- + +## License + +This Code of Conduct is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/docs/conf.py b/docs/conf.py index 7c2270a..35174b9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -110,12 +110,14 @@ "https://docs.sunpy.org/projects/sunkit-instruments/en/stable/", None, ), - "zeep": ("https://docs.python-zeep.org/en/stable/", None), "asdf": ("https://asdf.readthedocs.io/en/stable/", None), "sunpy": ("https://docs.sunpy.org/en/stable/", None), + "sunraster": ("https://docs.sunpy.org/projects/sunraster/en/stable/", None), + "zeep": ("https://docs.python-zeep.org/en/stable/", None), } # -- Options for HTML output ------------------------------------------------- +html_theme = "sunpy" graphviz_output_format = "svg" sphinx_gallery_conf = { "backreferences_dir": Path("generated") / "modules", diff --git a/docs/known_issues.rst b/docs/known_issues.rst index cfbac46..fb614b4 100644 --- a/docs/known_issues.rst +++ b/docs/known_issues.rst @@ -28,8 +28,7 @@ This means that one gets the correct answer only if one does the matrix multipli We work around this by modifying the PC_ij matrix to have the correct skew. Since the X CDELT is 1e-10 arcsec, the inverse is thankfully not infinity. -Using equation 187 in `Calabretta & Greisen 2002 -__`, we correct for this. +Using equation 187 in `Calabretta & Greisen 2002 __`, we correct for this. Note that since these pixels are extremely rectangular, an aspect ratio of ~3e-10, the cross terms in the PCij matrix are quite small: -3.4e-12 and -3.8e7. diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 13f500b..978f5cf 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -10,4 +10,5 @@ API Reference irispy sji spectrograph + io utils diff --git a/docs/reference/io.rst b/docs/reference/io.rst new file mode 100644 index 0000000..29973fa --- /dev/null +++ b/docs/reference/io.rst @@ -0,0 +1,7 @@ +**************** +IO (`irispy.io`) +**************** + +The `irispy.io` module provides tools to read level 2 files. + +.. automodapi:: irispy.io diff --git a/docs/reference/sji.rst b/docs/reference/sji.rst index e8b251d..1288864 100644 --- a/docs/reference/sji.rst +++ b/docs/reference/sji.rst @@ -5,3 +5,4 @@ SJI (`irispy.sji`) The `irispy.sji` module provides tools to read and work with level 2 SJI data. .. automodapi:: irispy.sji + :inherited-members: diff --git a/docs/reference/spectrograph.rst b/docs/reference/spectrograph.rst index da906af..c3a6d04 100644 --- a/docs/reference/spectrograph.rst +++ b/docs/reference/spectrograph.rst @@ -5,3 +5,4 @@ Spectrograph (`irispy.spectrograph`) The `irispy.spectrograph` module provides tools to read and work with level 2 spectrograph data. .. automodapi:: irispy.spectrograph + :inherited-members: diff --git a/examples/README.txt b/examples/README.txt index 9925296..29935a0 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1,5 +1,5 @@ -********* -Tutorials -********* +******** +Examples +******** -This gallery contains tutorials of how to use ``irispy-lmsal``. +This gallery contains examples of how to use ``irispy-lmsal``. diff --git a/examples/align_iris_aia_rolled.py b/examples/align_iris_aia_rolled.py index e2ea4db..6067d0c 100644 --- a/examples/align_iris_aia_rolled.py +++ b/examples/align_iris_aia_rolled.py @@ -196,7 +196,7 @@ # and for this we need to rotate one of them. We can either rotate SDO/AIA to the # IRIS frame, or vice-versa. # -# We will rotate the AIA data, using `.reproject_to`. +# We will rotate the AIA data, using `sunpy.map.Map.reproject_to`. # As `sunpy` does not support gWCS, we have to use the basic WCS. aia_rot = aia_sub.reproject_to(sji_cut.basic_wcs) diff --git a/irispy/_dev/scm_version.py b/irispy/_dev/scm_version.py index f4c2453..9a9168c 100644 --- a/irispy/_dev/scm_version.py +++ b/irispy/_dev/scm_version.py @@ -9,6 +9,6 @@ except ImportError as e: msg = "setuptools_scm not installed" raise ImportError(msg) from e -except Exception as e: # NOQA: BLE001 +except Exception as e: msg = f"setuptools_scm broken with {e}" raise ValueError(msg) from e