Conversation
| to_folium_map as to_folium_map, | ||
| ) | ||
|
|
||
| from .tsm import TSM as TSM |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Import alias does not rename original package Warning
| @@ -0,0 +1 @@ | |||
| from .tsm import TSM as TSM | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing module docstring Warning
| @@ -0,0 +1 @@ | |||
| from .tsm import TSM as TSM | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Import alias does not rename original package Warning
| @@ -0,0 +1,204 @@ | |||
| from __future__ import annotations | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing module docstring Warning
| # helpers | ||
| # ------------------------------------------------------------------ | ||
| @property | ||
| def _group_cols(self) -> list[str]: |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Value 'list' is unsubscriptable Warning
| to_folium_map as to_folium_map, | ||
| ) | ||
|
|
||
| from .tsm import TSM as TSM |
Check warning
Code scanning / Prospector (reported by Codacy)
Import alias does not rename original package (useless-import-alias) Warning
| to_folium_map as to_folium_map, | ||
| ) | ||
|
|
||
| from .tsm import TSM as TSM |
Check warning
Code scanning / Prospector (reported by Codacy)
'.tsm.TSM' imported but unused (F401) Warning
| @@ -0,0 +1 @@ | |||
| from .tsm import TSM as TSM | |||
Check warning
Code scanning / Prospector (reported by Codacy)
Import alias does not rename original package (useless-import-alias) Warning
| @@ -0,0 +1 @@ | |||
| from .tsm import TSM as TSM | |||
Check warning
Code scanning / Prospector (reported by Codacy)
'.tsm.TSM' imported but unused (F401) Warning
| # helpers | ||
| # ------------------------------------------------------------------ | ||
| @property | ||
| def _group_cols(self) -> list[str]: |
Check warning
Code scanning / Prospector (reported by Codacy)
Value 'list' is unsubscriptable (unsubscriptable-object) Warning
| @@ -0,0 +1 @@ | |||
| from .tsm import TSM as TSM | |||
Check warning
Code scanning / Pylint (reported by Codacy)
Missing module docstring Warning
| @@ -0,0 +1,204 @@ | |||
| from __future__ import annotations | |||
Check warning
Code scanning / Pylint (reported by Codacy)
No name 'annotations' in module 'future' Warning
| @@ -0,0 +1,204 @@ | |||
| from __future__ import annotations | |||
Check warning
Code scanning / Pylint (reported by Codacy)
Missing module docstring Warning
| """ | ||
|
|
||
| def __init__( | ||
| self, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| # helpers | ||
| # ------------------------------------------------------------------ | ||
| @property | ||
| def _group_cols(self) -> list[str]: |
Check warning
Code scanning / Pylint (reported by Codacy)
Value 'list' is unsubscriptable Warning
| # public API | ||
| # ------------------------------------------------------------------ | ||
| def clusterize( | ||
| self, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| # ------------------------------------------------------------------ | ||
| def clusterize( | ||
| self, | ||
| min_vehicles: int = 5, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
| def clusterize( | ||
| self, | ||
| min_vehicles: int = 5, | ||
| gap_factor: float = 3.0, |
Check warning
Code scanning / Pylint (reported by Codacy)
Wrong hanging indentation before block (add 4 spaces). Warning
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #410 +/- ##
=======================================
Coverage 87.21% 87.21%
=======================================
Files 52 52
Lines 6428 6428
Branches 714 714
=======================================
Hits 5606 5606
Misses 803 803
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tsm clustering spark
| @@ -0,0 +1,2 @@ | |||
| from .tsm import TSM as TSM | |||
| from .tsm import _get_or_create_spark | |||
Check warning
Code scanning / Prospector (reported by Codacy)
'.tsm._get_or_create_spark' imported but unused (F401) Warning
| from pathlib import Path | ||
| from typing import Dict, Optional | ||
|
|
||
| from pyspark.sql import DataFrame, SparkSession, Window |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'pyspark.sql' (import-error) Warning
| from typing import Dict, Optional | ||
|
|
||
| from pyspark.sql import DataFrame, SparkSession, Window | ||
| import pyspark.sql.functions as F |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'pyspark.sql.functions' (import-error) Warning
| import pyspark.sql.functions as F | ||
|
|
||
|
|
||
| def _get_or_create_spark( |
Check warning
Code scanning / Prospector (reported by Codacy)
Too many arguments (6/5) (too-many-arguments) Warning
There was a problem hiding this comment.
Pylint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| @@ -0,0 +1,2 @@ | |||
| from .tsm import TSM as TSM | |||
| from .tsm import _get_or_create_spark | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Trailing whitespace Warning
| import pyspark.sql.functions as F | ||
|
|
||
|
|
||
| def _get_or_create_spark( |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Too many arguments (6/5) Warning
| .config("spark.executor.memory", executor_memory) \ | ||
| .config("spark.sql.shuffle.partitions", str(shuffle_partitions)) \ | ||
| .config("spark.sql.adaptive.enabled", str(adaptive_enabled).lower()) \ | ||
| .config("spark.sql.adaptive.coalescePartitions.enabled", str(adaptive_coalesce_enabled).lower()) \ |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (106/100) Warning
| column_mapping: Optional[Dict[str, str]] = None, | ||
| ) -> None: | ||
| if column_mapping is not None: | ||
| df = data |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Variable name "df" doesn't conform to snake_case naming style Warning
| df = data | ||
| for src, eng in column_mapping.items(): | ||
| if src in df.columns: | ||
| df = df.withColumnRenamed(src, eng) |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Variable name "df" doesn't conform to snake_case naming style Warning
| ) | ||
| if intermediates: | ||
| self._result_intratimes = df.drop("new_cluster").drop("prev_timestamp") | ||
|
|
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Trailing whitespace Warning
| F.try_divide(F.col("num_vehicles"), F.col("cluster_len_km") * F.col("n_lanes")), | ||
| ).withColumn( | ||
| "flow", | ||
| F.try_divide(F.col("num_vehicles") * 3.6e3, F.col("cluster_dt_s") * F.col("n_lanes")), |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (102/100) Warning
| If :meth:`clusterize` has not been called yet. | ||
| """ | ||
| if self._result_intratimes is None: | ||
| raise RuntimeError("Call .clusterize() with intermediates=True before accessing .result_intratimes") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (112/100) Warning
| return self._result_intratimes | ||
|
|
||
| @property | ||
| def df(self) -> DataFrame: |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Attribute name "df" doesn't conform to snake_case naming style Warning
| rows = self._result.count() | ||
| else: | ||
| rows = self._df.count() | ||
| return f"TSM(status={status}, rows={rows})" No newline at end of file |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Final newline missing Warning
No description provided.