Skip to content

Commit

Permalink
Updates for black 25
Browse files Browse the repository at this point in the history
  • Loading branch information
timj authored and kfindeisen committed Jan 31, 2025
1 parent 440f5ac commit 67334c1
Show file tree
Hide file tree
Showing 38 changed files with 46 additions and 79 deletions.
3 changes: 1 addition & 2 deletions python/lsst/daf/butler/_butler_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Configuration classes specific to the Butler.
"""
"""Configuration classes specific to the Butler."""
from __future__ import annotations

__all__ = ("ButlerConfig",)
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/daf/butler/_deferredDatasetHandle.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Module containing classes used with deferring dataset loading.
"""
"""Module containing classes used with deferring dataset loading."""
from __future__ import annotations

__all__ = ("DeferredDatasetHandle",)
Expand Down
3 changes: 1 addition & 2 deletions python/lsst/daf/butler/registry/interfaces/_obscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Interfaces for classes that manage obscore table(s) in a `Registry`.
"""
"""Interfaces for classes that manage obscore table(s) in a `Registry`."""

from __future__ import annotations

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ def visitBinaryOp(
dtype=b.int | b.float | b.str | astropy.time.Time | datetime.datetime
) as lhs,
ColumnExpression() as rhs,
] if lhs.dtype is rhs.dtype:
] if (
lhs.dtype is rhs.dtype
):
return lhs.predicate_method(self.OPERATOR_MAP[operator], rhs)
# Allow comparisons between datetime expressions and
# astropy.time.Time literals/binds (only), by coercing the
Expand Down Expand Up @@ -321,7 +323,9 @@ def visitBinaryOp(
"+" | "-" | "*",
ColumnExpression(dtype=b.int | b.float) as lhs,
ColumnExpression() as rhs,
] if lhs.dtype is rhs.dtype:
] if (
lhs.dtype is rhs.dtype
):
return lhs.method(self.OPERATOR_MAP[operator], rhs, dtype=lhs.dtype)
case ["/", ColumnExpression(dtype=b.float) as lhs, ColumnExpression(dtype=b.float) as rhs]:
return lhs.method("__truediv__", rhs, dtype=b.float)
Expand Down Expand Up @@ -411,9 +415,9 @@ def visitIsIn(
assert isinstance(lhs, ColumnExpression), "LHS of IN guaranteed to be scalar by parser."
for rhs_item in values:
match rhs_item:
case ColumnExpressionSequence(
items=rhs_items, dtype=rhs_dtype
) if rhs_dtype is None or rhs_dtype == lhs.dtype:
case ColumnExpressionSequence(items=rhs_items, dtype=rhs_dtype) if (
rhs_dtype is None or rhs_dtype == lhs.dtype
):
items.extend(rhs_items)
case ColumnContainer(dtype=lhs.dtype):
clauses.append(rhs_item.contains(lhs))
Expand Down
3 changes: 1 addition & 2 deletions tests/test_astropyTableFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for AstropyTableFormatter.
"""
"""Tests for AstropyTableFormatter."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for Butler.
"""
"""Tests for Butler."""
from __future__ import annotations

import json
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdAssociate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI prune-datasets subcommand.
"""
"""Unit tests for daf_butler CLI prune-datasets subcommand."""

import unittest
from unittest.mock import patch
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdConfigDump.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI config-dump command.
"""
"""Unit tests for daf_butler CLI config-dump command."""

import os
import os.path
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdConfigValidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI config-validate command.
"""
"""Unit tests for daf_butler CLI config-validate command."""

import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdImport.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI config-dump command.
"""
"""Unit tests for daf_butler CLI config-dump command."""

import unittest
import unittest.mock
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdIngestFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI ingest-files command.
"""
"""Unit tests for daf_butler CLI ingest-files command."""

import json
import os
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdPruneDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI prune-datasets subcommand.
"""
"""Unit tests for daf_butler CLI prune-datasets subcommand."""

import unittest
from itertools import chain
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdQueryCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI query-collections command.
"""
"""Unit tests for daf_butler CLI query-collections command."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdQueryDataIds.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI query-collections command.
"""
"""Unit tests for daf_butler CLI query-collections command."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdQueryDatasetTypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI query-collections command.
"""
"""Unit tests for daf_butler CLI query-collections command."""

import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdQueryDatasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI query-datasets command.
"""
"""Unit tests for daf_butler CLI query-datasets command."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdQueryDimensionRecords.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI query-collections command.
"""
"""Unit tests for daf_butler CLI query-collections command."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdRemoveCollections.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI prune-collections subcommand.
"""
"""Unit tests for daf_butler CLI prune-collections subcommand."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdRemoveRuns.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI remove-runs subcommand.
"""
"""Unit tests for daf_butler CLI remove-runs subcommand."""


import os
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliCmdRetrieveArtifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for daf_butler CLI retrieve-artifacts command.
"""
"""Unit tests for daf_butler CLI retrieve-artifacts command."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliLog.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler dataset-type CLI option.
"""
"""Unit tests for the daf_butler dataset-type CLI option."""

import logging
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliPluginLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler CLI plugin loader.
"""
"""Unit tests for the daf_butler CLI plugin loader."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliUtilSplitCommas.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler shared CLI options.
"""
"""Unit tests for the daf_butler shared CLI options."""

import unittest
from unittest.mock import MagicMock
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliUtilSplitKv.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler shared CLI options.
"""
"""Unit tests for the daf_butler shared CLI options."""

import unittest
from functools import partial
Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliUtilToUpper.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler shared CLI options.
"""
"""Unit tests for the daf_butler shared CLI options."""

import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_cliUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Unit tests for the daf_butler shared CLI options.
"""
"""Unit tests for the daf_butler shared CLI options."""

import unittest
from unittest.mock import MagicMock
Expand Down
3 changes: 1 addition & 2 deletions tests/test_connectionString.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for ConnectionStringBuilder.
"""
"""Tests for ConnectionStringBuilder."""

import glob
import os
Expand Down
3 changes: 1 addition & 2 deletions tests/test_ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Unit tests for methods in butler.ddl module.
"""
"""Unit tests for methods in butler.ddl module."""

import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_exprParserLex.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Simple unit test for expr_parser/parserLex module.
"""
"""Simple unit test for expr_parser/parserLex module."""

import re
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_exprParserYacc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Simple unit test for exprParser subpackage module.
"""
"""Simple unit test for exprParser subpackage module."""

import unittest

Expand Down
3 changes: 1 addition & 2 deletions tests/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests related to the formatter infrastructure.
"""
"""Tests related to the formatter infrastructure."""

import inspect
import os.path
Expand Down
3 changes: 1 addition & 2 deletions tests/test_logFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for ButlerLogRecordsFormatter.
"""
"""Tests for ButlerLogRecordsFormatter."""

import logging
import os
Expand Down
3 changes: 1 addition & 2 deletions tests/test_matplotlibFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for MatplotlibFormatter.
"""
"""Tests for MatplotlibFormatter."""

import os
import tempfile
Expand Down
3 changes: 1 addition & 2 deletions tests/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Tests for PackagesFormatter.
"""
"""Tests for PackagesFormatter."""

import os
import unittest
Expand Down
3 changes: 1 addition & 2 deletions tests/test_query_direct_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Tests for DirectButler._query with PostgreSQL.
"""
"""Tests for DirectButler._query with PostgreSQL."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions tests/test_query_direct_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Tests for DirectButler._query with SQLite.
"""
"""Tests for DirectButler._query with SQLite."""

from __future__ import annotations

Expand Down
3 changes: 1 addition & 2 deletions tests/test_query_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

"""Tests for DirectButler._query with SQLite.
"""
"""Tests for DirectButler._query with SQLite."""

from __future__ import annotations

Expand Down
Loading

0 comments on commit 67334c1

Please sign in to comment.