Skip to content

Commit

Permalink
summarize whats's new
Browse files Browse the repository at this point in the history
  • Loading branch information
somilia committed Oct 9, 2023
2 parents 63524e4 + 3687270 commit 189d220
Show file tree
Hide file tree
Showing 92 changed files with 1,151 additions and 705 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
@@ -1,4 +1,4 @@
<!-- This comments are hidden when you submit the pull request,
<!-- These comments are hidden when you submit the pull request,
so you do not need to remove them! -->

<!-- Please be sure to check out our contributing guidelines,
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/ci_cron_weekly.yml
Expand Up @@ -63,13 +63,6 @@ jobs:
python: '3.10'
toxenv: flynt

# TODO: Uncomment when 3.12 is more mature. Should we use devdeps?
# Test against Python dev in cron job.
#- name: Python dev with basic dependencies
# os: ubuntu-latest
# python: 3.12-dev
# toxenv: pydev-test

steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_workflows.yml
Expand Up @@ -108,7 +108,6 @@ jobs:
envs: |
- name: (Allowed Failure) Python 3.12 with remote data and dev version of key dependencies
linux: py312-test-devdeps
python-version: '3.12-dev'
posargs: --remote-data=any --verbose
# https://github.com/matplotlib/matplotlib/issues/26847
Expand Down
11 changes: 3 additions & 8 deletions .pre-commit-config.yaml
Expand Up @@ -8,8 +8,6 @@ repos:
hooks:
- id: check-added-large-files
# Prevent giant files from being committed.
- id: check-ast
# Simply check whether files parse as valid python.
- id: check-case-conflict
# Check for files with names that would conflict on a case-insensitive
# filesystem like MacOS HFS+ or Windows FAT.
Expand All @@ -26,9 +24,6 @@ repos:
- id: check-yaml
# Attempts to load all yaml files to verify syntax.
exclude: ".*(.github.*)$"
- id: debug-statements
# Check for debugger imports and py37+ breakpoint() calls in python
# source.
- id: detect-private-key
# Checks for the existence of private keys.
- id: end-of-file-fixer
Expand Down Expand Up @@ -64,7 +59,7 @@ repos:
- tomli

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.0.287"
rev: "v0.0.291"
hooks:
- id: ruff
args: ["--fix"]
Expand Down Expand Up @@ -107,12 +102,12 @@ repos:
)
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.7.0
rev: 23.9.1
hooks:
- id: black

- repo: https://github.com/asmeurer/removestar
rev: "1.4"
rev: "1.5"
hooks:
- id: removestar
args: ["-iv"] # in-place changes + verbose output
Expand Down
98 changes: 57 additions & 41 deletions .ruff.toml
Expand Up @@ -49,7 +49,6 @@ ignore = [
# flake8-datetimez (DTZ)
"DTZ001", # call-datetime-without-tzinfo
"DTZ005", # call-datetime-now-without-tzinfo
"DTZ007", # call-datetime-strptime-without-zone

# pycodestyle (E, W)
"E501", # line-too-long
Expand Down Expand Up @@ -79,13 +78,8 @@ ignore = [

# flake8-fixme (FIX)
"FIX001", # Line contains FIXME. this should be fixed or at least FIXME replaced with TODO
"FIX003", # Line contains XXX. replace XXX with TODO
"FIX004", # Line contains HACK. replace HACK with NOTE.

# flake8-logging-format (G)
"G001", # logging-string-format
"G004", # logging-f-string

# flake8-import-conventions (ICN) : use conventional import aliases
"ICN001", # import-conventions

Expand All @@ -97,12 +91,9 @@ ignore = [
"N804", # invalid-first-argument-name-for-class-method
"N805", # invalid-first-argument-name-for-method
"N807", # dunder-function-name
"N811", # constant-imported-as-non-constant
"N812", # lowercase-imported-as-non-lowercase
"N813", # camelcase-imported-as-lowercase
"N815", # mixed-case-variable-in-class-scope
"N816", # mixed-case-variable-in-global-scope
"N817", # camelcase-imported-as-acronym
"N818", # error-suffix-on-exception-name

# NumPy-specific rules (NPY)
Expand All @@ -112,16 +103,11 @@ ignore = [
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PERF401", # Use a list comprehension to create a transformed list

# flake8-pie (PIE)
"PIE794", # duplicate-class-field-definition

# pygrep-hooks (PGH)
"PGH001", # eval

# Pylint (PLC, PLE, PLR, PLW)
"PLC1901", # compare-to-empty-string
"PLE0101", # return-in-init
"PLE0605", # invalid-all-format
"PLR0124", # Name compared with itself
"PLR0402", # ConsiderUsingFromImport
"PLR0911", # too-many-return-statements
Expand All @@ -144,7 +130,6 @@ ignore = [
"PT012", # pytest-raises-with-multiple-statements
"PT017", # pytest-assert-in-exceptinstead
"PT018", # pytest-composite-assertion
"PT019", # pytest-fixture-param-without-value
"PT022", # pytest-useless-yield-fixture
"PT023", # pytest-incorrect-mark-parentheses-style

Expand All @@ -161,15 +146,12 @@ ignore = [
"PTH111", # os-path-expanduser
"PTH112", # os-path-isdir
"PTH113", # os-path-isfile
"PTH114", # os-path-islink
"PTH116", # os-stat
"PTH118", # os-path-join
"PTH119", # os-path-basename
"PTH120", # os-path-dirname
"PTH122", # os-path-splitext
"PTH123", # builtin-open
"PTH202", # `os.path.getsize` should be replaced by `Path.stat().st_size`
"PTH206", # Replace `.split(os.sep)` with `Path.parts`
"PTH207", # Replace `glob` with `Path.glob` or `Path.rglob`

# flake8-return (RET)
Expand All @@ -180,7 +162,6 @@ ignore = [
"RET505", # superfluous-else-return
"RET506", # superfluous-else-raise
"RET507", # superfluous-else-continue
"RET508", # superfluous-else-break

# flake8-raise (RSE)
"RSE102", # unnecessary-paren-on-raise-exception
Expand All @@ -198,15 +179,12 @@ ignore = [
"S112", # try-except-continue
"S301", # suspicious-pickle-usage
"S307", # Use of possibly insecure function; consider using `ast.literal_eval`
"S311", # suspecious-non-cryptographic-randomness
"S311", # suspicious-non-cryptographic-randomness
"S324", # hashlib-insecure-hash-function
"S506", # UnsafeYAMLLoad
"S310", # Suspicious-url-open-usage
"S321", # Suspecious-ftp-lib-usage
"S603", # `subprocess` call: check for execution of untrusted input
"S605", # Starting a process with a shell, possible injection detected (2023-05-03)
"S607", # Starting a process with a partial executable path
"S608", # Posslibe SQL injection

# flake8-simplify (SIM)
"SIM102", # NestedIfStatements
Expand All @@ -217,21 +195,15 @@ ignore = [
"SIM117", # MultipleWithStatements
"SIM118", # KeyInDict
"SIM201", # NegateEqualOp
"SIM202", # NegateNotEqualOp
"SIM300", # yoda condition

# flake8-slots (SLOT)
"SLOT000", # Subclasses of `str` should define `__slots__`
"SLOT001", # Subclasses of `tuple` should define `__slots__`

# flake8-print (T20)
"T201", # PrintUsed

# flake8-todos (TD)
"TD001", # Invalid TODO tag
"TD003", # Missing issue link on the line following this TODO
"TD004", # Missing colon in TODO
"TD005", # Missing issue description after `TODO`
"TD007", # Missing space after colon in TODO

# tryceratops (TRY)
Expand All @@ -242,7 +214,6 @@ ignore = [
"TRY201", # verbose-raise
"TRY300", # Consider `else` block
"TRY301", # raise-within-try
"TRY400", # error-instead-of-exception

# flake8-quotes (Q)
"Q000", # use double quotes
Expand All @@ -261,25 +232,70 @@ unfixable = [
# is better to fix for subpackages individually. The general exclusion should be
# copied to these subpackage sections and fixed there.
"astropy/__init__.py" = ["C408"]
"astropy/config/*" = []
"astropy/constants/*" = []
"astropy/config/*" = [
"PTH114", # os-path-islink
"PTH206", # Replace `.split(os.sep)` with `Path.parts`
]
"astropy/constants/*" = ["N817"] # camelcase-imported-as-acronym
"astropy/convolution/*" = []
"astropy/coordinates/*" = ["C408"]
"astropy/cosmology/*" = ["C408"]
"astropy/io/*" = ["PIE790"]
"astropy/coordinates/*" = [
"C408", # unnecessary-collection-call
"DTZ007", # call-datetime-strptime-without-zone
]
"astropy/cosmology/*" = [
"C408", # unnecessary-collection-call
"PT019", # pytest-fixture-param-without-value
]
"astropy/io/*" = [
"G001", # logging-string-format
"G004", # logging-f-string
"PIE790", # unnecessary-pass
"PTH116", # os-stat
"SLOT000", # Subclasses of `str` should define `__slots__`
"TD005", # Missing issue description after `TODO`
"TRY400", # error-instead-of-exception
]
"astropy/logger.py" = ["C408"]
"astropy/modeling/*" = ["C408"]
"astropy/modeling/*" = [
"C408", # unnecessary-collection-call
"SLOT001", # Subclasses of `tuple` should define `__slots__`
]
"astropy/nddata/*" = ["C408"]
"astropy/samp/*" = []
"astropy/stats/*" = []
"astropy/table/*" = ["C408", "PIE790"]
"astropy/table/*" = [
"C408", # unnecessary-collection-call
"PIE790", # unnecessary-pass
"S605", # Starting a process with a shell, possible injection detected
]
"astropy/tests/*" = ["C408"]
"astropy/time/*" = ["C408", "PIE790"]
"astropy/time/*" = [
"C408", # unnecessary-collection-call
"FIX003", # Line contains XXX. replace XXX with TODO
"PIE790", # unnecessary-pass
"PIE794", # duplicate-class-field-definition
]
"astropy/timeseries/*" = ["C408"]
"astropy/units/*" = ["C408", "F821", "PIE790"]
"astropy/units/*" = [
"C408", # unnecessary-collection-call
"F821", # undefined-name
"N812", # lowercase-imported-as-non-lowercase
"PIE790", # unnecessary-pass
]
"astropy/uncertainty/*" = ["C408", "PIE790"]
"astropy/utils/*" = ["C408", "PIE790"]
"astropy/utils/*" = [
"C408", # unnecessary-collection-call
"N811", # constant-imported-as-non-constant
"PIE790", # unnecessary-pass
"S321", # Suspicious-ftp-lib-usage
]
"astropy/visualization/*" = ["B015", "C408", "PIE790"]
"astropy/wcs/*" = ["C408", "F821", "PIE790"]
"astropy/wcs/*" = [
"C408", # unnecessary-collection-call
"F821", # undefined-name
"PIE790", # unnecessary-pass
"S608", # Posslibe SQL injection
"SIM202", # NegateNotEqualOp
]
"docs/*" = []
"examples/coordinates/*" = []
47 changes: 46 additions & 1 deletion CHANGES.rst
@@ -1,3 +1,48 @@
Version 5.3.4 (2023-10-03)
==========================

Bug Fixes
---------

astropy.io.misc
^^^^^^^^^^^^^^^

- Updated ``astropy.io.misc.yaml`` so ``dump()` with a numpy object array or
``load()`` with YAML representing a Numpy object array both raise
``TypeError``. This prevents problems like a segmentation fault. [#15373]

astropy.io.votable
^^^^^^^^^^^^^^^^^^

- Fixed a bug in ``convert_to_writable_filelike`` where ``GzipFile`` was not
closed properly. [#15359]

astropy.units
^^^^^^^^^^^^^

- In VOUnit, the spaces around the slash were removed in the formatting of
fractions, and fractional powers now also use the "**" operator. [#15282]

- We now ensure that the unit ``u.cgs.cm`` is just an alias of ``u.si.cm``,
instead of a redefinition. This ensures that ``u.Unit("cm") / u.cm``
will reliably cancel to dimensionless (instead of some "cm / cm"). [#15368]

astropy.utils
^^^^^^^^^^^^^

- For ``Masked``, ``np.ptp`` and the ``.ptp()`` method now properly account for
the mask, ensuring the result is identical to subtracting the maximum and
minimum (with the same arguments). [#15380]

Other Changes and Additions
---------------------------

- Compatibility with Python 3.12. [#14784]

- Replaced the URL of ``IETF_LEAP_SECOND_URL`` because the original is now
defunct and IETF now defers to IANA for such look-up. [#15421]


Version v5.3.3 (2023-09-07)
===========================

Expand Down Expand Up @@ -12695,7 +12740,7 @@ Bug Fixes

- Fixed unnecessary attempt to run ``git`` when importing astropy. In
particular, fixed a crash in Python 3 that could result from this when
importing Astropy when the the current working directory is an empty git
importing Astropy when the current working directory is an empty git
repository. [#3475]

Other Changes and Additions
Expand Down
2 changes: 1 addition & 1 deletion astropy/__init__.py
Expand Up @@ -225,7 +225,7 @@ def online_help(query):
and locals()[varname].__name__.startswith(__name__ + ".")
)
):
# The last clause in the the above disjunction deserves explanation:
# The last clause in the above disjunction deserves explanation:
# When using relative imports like ``from .. import config``, the
# ``config`` variable is automatically created in the namespace of
# whatever module ``..`` resolves to (in this case astropy). This
Expand Down

0 comments on commit 189d220

Please sign in to comment.