Skip to content

Commit

Permalink
build: pre-commit autoupdate (#102)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/pre-commit/mirrors-mypy: v1.7.1 → v1.8.0](pre-commit/mirrors-mypy@v1.7.1...v1.8.0)
- [github.com/pycqa/isort: 5.13.1 → 5.13.2](PyCQA/isort@5.13.1...5.13.2)
- [github.com/psf/black: 23.11.0 → 24.1.1](psf/black@23.11.0...24.1.1)
- [github.com/PyCQA/flake8: 6.1.0 → 7.0.0](PyCQA/flake8@6.1.0...7.0.0)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: JuanPedroGHM <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and JuanPedroGHM authored Feb 1, 2024
1 parent 5907f17 commit 0af0896
Show file tree
Hide file tree
Showing 28 changed files with 43 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
# - id: poetry-export
# args: ["-f", "requirements.txt", "-o", "requirements.txt"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1 # Use the sha / tag you want to point at
rev: v1.8.0 # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies: [types-all]
Expand All @@ -31,12 +31,12 @@ repos:
args:
- --exclude=examples/
- repo: https://github.com/pycqa/isort
rev: 5.13.1
rev: 5.13.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand All @@ -47,7 +47,7 @@ repos:
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
- repo: "https://github.com/citation-file-format/cffconvert"
Expand Down
1 change: 1 addition & 0 deletions perun/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""perun module."""

# flake8: noqa
__version__ = "0.5.0"
from perun.configuration import config
Expand Down
1 change: 1 addition & 0 deletions perun/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""perun module."""

if __name__ == "__main__":
from perun.api.cli import cli

Expand Down
1 change: 1 addition & 0 deletions perun/api/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Command line API."""

import argparse
import json
import logging
Expand Down
1 change: 1 addition & 0 deletions perun/api/decorator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Decorator module."""

import functools
import logging
from typing import Optional
Expand Down
1 change: 1 addition & 0 deletions perun/backend/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Backend module."""

import logging
from abc import ABC, abstractmethod
from typing import Dict, List, Set
Expand Down
1 change: 1 addition & 0 deletions perun/backend/nvml.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Nvidia Mangement Library Source definition."""

import importlib
import logging
from typing import Callable, List, Set
Expand Down
1 change: 1 addition & 0 deletions perun/backend/powercap_rapl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defines Intel RAPL related classes."""

import logging
import os
import pprint as pp
Expand Down
1 change: 1 addition & 0 deletions perun/backend/psutil.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""psutil backend."""

from typing import Callable, List, Set

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions perun/backend/rocmsmi.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""ROCM Backend."""

import importlib
import logging
from typing import Callable, List, Set
Expand Down
1 change: 1 addition & 0 deletions perun/backend/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Backend util."""

import logging
import platform
from typing import Any, Dict, Set
Expand Down
1 change: 1 addition & 0 deletions perun/comm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Comm module."""

import logging
from typing import Any, List, Optional

Expand Down
1 change: 1 addition & 0 deletions perun/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration module."""

# gCO2eq/kWh - source: https://ourworldindata.org/grapher/carbon-intensity-electricity Global Average
# Currency/kWh (Euro) - source: https://www.stromauskunft.de/strompreise/ 03.05.2023
import configparser
Expand Down
1 change: 1 addition & 0 deletions perun/coordination.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Coordination module."""

import logging
import pprint as pp
from typing import Dict, List, Set, Tuple
Expand Down
15 changes: 9 additions & 6 deletions perun/data_model/data.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Storage Module."""

import dataclasses
import enum
import logging
Expand Down Expand Up @@ -377,12 +378,14 @@ def toDict(self, include_raw_data: bool = True) -> Dict:
type.value: dataclasses.asdict(metric)
for type, metric in self.metrics.items()
},
"regions": {
region_name: region.toDict()
for region_name, region in self.regions.items()
}
if self.regions
else None,
"regions": (
{
region_name: region.toDict()
for region_name, region in self.regions.items()
}
if self.regions
else None
),
"deviceType": self.deviceType,
"processed": self.processed,
}
Expand Down
1 change: 1 addition & 0 deletions perun/data_model/measurement_type.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unit module."""

import dataclasses
import enum
import logging
Expand Down
1 change: 1 addition & 0 deletions perun/data_model/sensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Device module."""

import enum
from dataclasses import asdict, dataclass
from typing import Any, Callable, Dict
Expand Down
1 change: 1 addition & 0 deletions perun/io/bench.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Bench io module."""

import json
import logging
from typing import Dict, List, Tuple
Expand Down
1 change: 1 addition & 0 deletions perun/io/hdf5.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""HDF5 IO module."""

from pathlib import Path
from typing import Dict, Union

Expand Down
1 change: 1 addition & 0 deletions perun/io/json.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""IO Json module."""

import json

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions perun/io/pandas.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pandas IO module."""

from pathlib import Path
from typing import Any, List, Tuple

Expand Down
1 change: 1 addition & 0 deletions perun/io/pickle.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""IO Pickle module."""

import pickle

from perun.data_model.data import DataNode
Expand Down
1 change: 1 addition & 0 deletions perun/io/text_report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Text report module."""

import pandas as pd

from perun import config, log
Expand Down
1 change: 1 addition & 0 deletions perun/io/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""IO Util."""

from typing import Tuple

import numpy as np
Expand Down
1 change: 1 addition & 0 deletions perun/perun.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core perun functionality."""

import logging
import os
import platform
Expand Down
9 changes: 5 additions & 4 deletions perun/processing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Processing Module."""

import copy
import logging
from configparser import ConfigParser
Expand Down Expand Up @@ -191,9 +192,9 @@ def processSensorData(sensorData: DataNode) -> DataNode:

elif sensorData.deviceType == DeviceType.OTHER:
sensorData.metrics[MetricType.OTHER_ENERGY] = energyMetric.copy()
sensorData.metrics[
sensorData.metrics[MetricType.OTHER_ENERGY].type = (
MetricType.OTHER_ENERGY
].type = MetricType.OTHER_ENERGY
)
sensorData.metrics[MetricType.OTHER_POWER] = powerMetric.copy()
sensorData.metrics[MetricType.OTHER_POWER].type = MetricType.OTHER_POWER

Expand Down Expand Up @@ -249,9 +250,9 @@ def processSensorData(sensorData: DataNode) -> DataNode:

elif sensorData.deviceType == DeviceType.OTHER:
sensorData.metrics[MetricType.OTHER_ENERGY] = energyMetric.copy()
sensorData.metrics[
sensorData.metrics[MetricType.OTHER_ENERGY].type = (
MetricType.OTHER_ENERGY
].type = MetricType.OTHER_ENERGY
)
sensorData.metrics[MetricType.OTHER_POWER] = powerMetric.copy()
sensorData.metrics[MetricType.OTHER_POWER].type = MetricType.OTHER_POWER

Expand Down
1 change: 1 addition & 0 deletions perun/subprocess.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Perun subprocess module."""

import logging
import platform
import time
Expand Down
1 change: 1 addition & 0 deletions perun/util.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Util module."""

import os
import re
from datetime import datetime
Expand Down

0 comments on commit 0af0896

Please sign in to comment.