Skip to content

Commit

Permalink
chore(deps): use super-linter v7
Browse files Browse the repository at this point in the history
  • Loading branch information
RDWimmers committed Oct 1, 2024
1 parent 93d30dd commit b30b840
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
fetch-depth: 0

- name: Lint
uses: github/super-linter@v5
uses: super-linter/super-linter@v7
env:
VALIDATE_ALL_CODEBASE: false
DEFAULT_BRANCH: main
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,7 @@ module = [
"pyproj.*",
"pandas.*",
"numpy.*",
"boto3.*",
"botocore.*",
]
ignore_missing_imports = true
6 changes: 5 additions & 1 deletion run_super_linter.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/bin/bash

docker run \
--env FIX_PYTHON_BLACK=true \
--env FIX_PYTHON_ISORT=true \
--env FIX_PYTHON_PYINK=true \
--env DEFAULT_BRANCH=main \
--env VALIDATE_ALL_CODEBASE=false \
--env RUN_LOCAL=true \
--env VALIDATE_JSCPD=false \
Expand All @@ -16,4 +20,4 @@ docker run \
--env PYTHON_ISORT_CONFIG_FILE=pyproject.toml \
--env PYTHON_MYPY_CONFIG_FILE=pyproject.toml \
--env PYTHON_FLAKE8_CONFIG_FILE=.flake8 \
-v $(pwd):/tmp/lint github/super-linter:v5
-v $(pwd):/tmp/lint ghcr.io/super-linter/super-linter:v7
22 changes: 8 additions & 14 deletions src/baec/measurements/basetime_measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@


class Credentials:

def __init__(
self,
aws_access_key_id: str | None = None,
Expand Down Expand Up @@ -66,10 +67,9 @@ def __init__(
@classmethod
def from_csv(
cls,
filepath_or_buffer: str
| PathLike[str]
| ReadCsvBuffer[bytes]
| ReadCsvBuffer[str],
filepath_or_buffer: (
str | PathLike[str] | ReadCsvBuffer[bytes] | ReadCsvBuffer[str]
),
) -> "Credentials":
"""
Any valid string path is acceptable. Credentials needs to refer to the AWS credential file given by Basetime.
Expand Down Expand Up @@ -136,13 +136,7 @@ def __init__(
Returns
-------
series : ProjectsIDs [dict]
A overview of all the available projects and connected settlement rods within every project. [dict]
<Keys> : project names
<Values> : list of Point IDs inside every project.
series : SettlementRodMeasurementSeries
A SettlementRodMeasurementSeries object for every available rod measurement, to be called within the class
ProjectsIDs
Raises
------
Expand Down Expand Up @@ -211,9 +205,9 @@ def __init__(
self.lambda_c = lambda_client
self.dict_errors = dict_errors
self.dic_projects = self.get_users_projects_ids()
self.settlement_cache: Dict[
Tuple[str, str], SettlementRodMeasurementSeries
] = {}
self.settlement_cache: Dict[Tuple[str, str], SettlementRodMeasurementSeries] = (
{}
)

def get_users_projects_ids(self) -> Dict:
"""
Expand Down
58 changes: 28 additions & 30 deletions tests/measurements/io/test_basetime_measurement.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
import pandas as pd
from datetime import datetime
import os

from baec.measurements.basetime_measurements import ProjectsIDs, Credentials

"""
Test script for the Basetime connection.
Credentials file is not loaded in env, but stored locally
def test_basetime_connection():
"""
Test script for the Basetime connection.
Credentials file is not loaded in env, but stored locally
testing:
-Output when calling company, projects, object IDs
-Output when calling a series of an object ID
"""
print(datetime.now())
time_start = datetime.now()
testing:
-Output when calling company, projects, object IDs
-Output when calling a series of an object ID
"""
print(datetime.now())
time_start = datetime.now()

# get AWS credentials
credentials = Credentials()
# get AWS credentials
credentials = Credentials()

manage_project = ProjectsIDs(credentials)

print(datetime.now()-time_start)
time_start = datetime.now()
print(manage_project.get_users_projects_ids())
test_series = manage_project.make_SettlementRodMeasurementSeries(
project="Voorbelasting Wilderszijde Lansingerland", rod_id="ZB-1001"
)
manage_project = ProjectsIDs(credentials)

print(test_series.to_dataframe())
print(datetime.now()-time_start)
time_start = datetime.now()
test_series = manage_project.make_SettlementRodMeasurementSeries(
project="Voorbelasting Wilderszijde Lansingerland", rod_id="ZB-1001"
)
print(test_series.to_dataframe())
print(datetime.now()-time_start)
time_start = datetime.now()
print(datetime.now()-time_start)
time_start = datetime.now()
print(manage_project.get_users_projects_ids())
test_series = manage_project.make_SettlementRodMeasurementSeries(
project="Voorbelasting Wilderszijde Lansingerland", rod_id="ZB-1001"
)

print(test_series.to_dataframe())
print(datetime.now()-time_start)
time_start = datetime.now()
test_series = manage_project.make_SettlementRodMeasurementSeries(
project="Voorbelasting Wilderszijde Lansingerland", rod_id="ZB-1001"
)
print(test_series.to_dataframe())
print(datetime.now()-time_start)

0 comments on commit b30b840

Please sign in to comment.