Skip to content

Commit

Permalink
chore: pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
markusrf committed Sep 29, 2023
1 parent af6bee9 commit a310df2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
11 changes: 6 additions & 5 deletions src/ecalc_cli/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
import libecalc.common.time_utils
import libecalc.version
import typer
from libecalc.common.run_info import RunInfo
from libecalc.core.ecalc import EnergyCalculator
from libecalc.core.graph_result import GraphResult
from libecalc.input.model import YamlModel
from libecalc.output.utils.file_utils import OutputFormat, get_result_output

from ecalc_cli.errors import EcalcCLIError
from ecalc_cli.io.cache import Cache
from ecalc_cli.io.output import (
Expand All @@ -15,11 +21,6 @@
)
from ecalc_cli.logger import logger
from ecalc_cli.types import DateFormat, Frequency
from libecalc.common.run_info import RunInfo
from libecalc.core.ecalc import EnergyCalculator
from libecalc.core.graph_result import GraphResult
from libecalc.input.model import YamlModel
from libecalc.output.utils.file_utils import OutputFormat, get_result_output


def run(
Expand Down
3 changes: 2 additions & 1 deletion src/ecalc_cli/commands/selftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import libecalc.version
from ecalc_cli.logger import logger
from ecalc_neqsim_wrapper import start_server

from ecalc_cli.logger import logger


def selftest_java() -> bool:
"""Check java installation.
Expand Down
9 changes: 5 additions & 4 deletions src/ecalc_cli/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import libecalc.common.time_utils
import libecalc.version
import typer
from ecalc_cli.io.cache import Cache
from ecalc_cli.io.output import write_output
from ecalc_cli.logger import logger
from ecalc_cli.types import DateFormat, Frequency
from libecalc.input.yaml.yaml_models.pyyaml_yaml_model import PyYamlYamlModel
from libecalc.input.yaml_entities import ResourceStream
from libecalc.output.utils.file_utils import (
Expand All @@ -15,6 +11,11 @@
get_result_output,
)

from ecalc_cli.io.cache import Cache
from ecalc_cli.io.output import write_output
from ecalc_cli.logger import logger
from ecalc_cli.types import DateFormat, Frequency

app = typer.Typer()


Expand Down
3 changes: 2 additions & 1 deletion src/ecalc_cli/io/cache.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
from dataclasses import dataclass, field
from pathlib import Path

from ecalc_cli.logger import logger
from libecalc import dto
from libecalc.common.run_info import RunInfo
from libecalc.core.graph_result import EnergyCalculatorResult, GraphResult
from libecalc.dto.base import EcalcBaseModel
from libecalc.dto.result import EcalcModelResult

from ecalc_cli.logger import logger


class CacheData(EcalcBaseModel):
"""Data model for content in cache."""
Expand Down
3 changes: 2 additions & 1 deletion src/ecalc_cli/io/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from typing import Dict, List

import libecalc.common.time_utils
from ecalc_cli.errors import EcalcCLIError
from libecalc import dto
from libecalc.common.run_info import RunInfo
from libecalc.common.time_utils import resample_time_steps
Expand All @@ -17,6 +16,8 @@
from libecalc.output.results.handlers.handler import MultiFileHandler
from libecalc.output.utils.file_utils import OutputFormat, get_result_output

from ecalc_cli.errors import EcalcCLIError


def write_output(output: str, output_file: Path = None):
"""Write output of eCalc run to either file (if output file path is specified) or to stdout.
Expand Down
3 changes: 2 additions & 1 deletion src/ecalc_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import libecalc.version
import typer
from libecalc.input.validation_errors import DataValidationError

from ecalc_cli.commands import show
from ecalc_cli.commands.run import run
from ecalc_cli.commands.selftest import selftest
from ecalc_cli.logger import CLILogConfigurator, LogLevel, logger
from libecalc.input.validation_errors import DataValidationError

app = typer.Typer(name="ecalc")

Expand Down

0 comments on commit a310df2

Please sign in to comment.