Skip to content

Commit

Permalink
Update black formatter version.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Feb 1, 2024
1 parent d00ab25 commit df07939
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: requirements-txt-fixer

- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.1.1
hooks:
- id: black

Expand Down
1 change: 1 addition & 0 deletions dp3/.core_modules/update_planner.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Note:
Core modules needs to be enabled in worker.py and not in config!
"""

import logging
from datetime import timedelta

Expand Down
1 change: 1 addition & 0 deletions dp3/bin/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DP3 Setup Config Script for creating a DP3 application."""

import shutil
import sys
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions dp3/bin/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""DP3 Setup Script for creating a DP3 application."""

import argparse
import contextlib
import shutil
Expand Down
1 change: 1 addition & 0 deletions dp3/common/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Platform config file reader and config model.
"""

import os
from typing import Annotated, Optional, Union

Expand Down
1 change: 1 addition & 0 deletions dp3/common/control.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module enabling remote control of the platform's internal events.
"""

import logging
from enum import Enum
from typing import Callable
Expand Down
3 changes: 1 addition & 2 deletions dp3/common/entityspec.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from dp3.common.types import ParsedTimedelta


class SpecModel(BaseModel, extra=Extra.forbid):
...
class SpecModel(BaseModel, extra=Extra.forbid): ...


class ImmortalLifetime(SpecModel):
Expand Down
1 change: 1 addition & 0 deletions dp3/common/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
auxiliary/utility functions and classes
"""

import datetime
import re
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions dp3/core/collector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Core module performing deletion of entities based on specified policy.
"""

import logging
from collections import defaultdict
from datetime import datetime, timedelta
Expand Down
1 change: 1 addition & 0 deletions dp3/core/link_manager.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Core module managing links between entities.
"""

import logging
from datetime import datetime, timedelta
from functools import partial
Expand Down
7 changes: 4 additions & 3 deletions dp3/history_management/history_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ def compress_file(original: Path, compressed: Path = None):
if compressed is None:
compressed = original.parent / (original.name + ".gz")

with open(original, encoding="utf-8") as in_fp, gzip.open(
compressed, "wt", encoding="utf-8"
) as out_fp:
with (
open(original, encoding="utf-8") as in_fp,
gzip.open(compressed, "wt", encoding="utf-8") as out_fp,
):
out_fp.writelines(in_fp)
1 change: 1 addition & 0 deletions dp3/snapshots/snapshooter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Callbacks for data correlation and fusion should happen here
- Save the complete results into database as snapshots
"""

import logging
from collections import defaultdict
from datetime import datetime
Expand Down
1 change: 1 addition & 0 deletions dp3/snapshots/snapshot_hooks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Module managing registered hooks and their dependencies on one another.
"""

import logging
from collections import defaultdict
from collections.abc import Hashable
Expand Down
12 changes: 4 additions & 8 deletions tests/test_common/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ def get_master_record(self, etype: str, eid: str, projection=None) -> dict:

def register_on_entity_delete(
self, f_one: Callable[[str, str], None], f_many: Callable[[str, list[str]], None]
):
...
): ...

def get_module_cache(self, override_called_id: Optional[str] = None):
return self.module_cache
Expand All @@ -146,20 +145,17 @@ def put_task(self, task: Task, priority: bool = False):


class MockTaskQueueReader:
def ack(self, msg_tag):
...
def ack(self, msg_tag): ...


class MockCollection(dict):
def create_index(self, *args, **kwargs):
...
def create_index(self, *args, **kwargs): ...


class MockTaskExecutor:
elog = DummyEventGroup()

def register_attr_hook(self, *args, **kwargs):
...
def register_attr_hook(self, *args, **kwargs): ...


class TestSnapshotOperation(unittest.TestCase):
Expand Down

0 comments on commit df07939

Please sign in to comment.