diff --git a/_coverage/d_0f042be92a388500___init___py.html b/_coverage/d_0f042be92a388500___init___py.html index 15ba1cd..e528111 100644 --- a/_coverage/d_0f042be92a388500___init___py.html +++ b/_coverage/d_0f042be92a388500___init___py.html @@ -62,10 +62,10 @@

« prev     ^ index     - » next + » next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

-

- « prev     - ^ index     - » next -       - coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 -

- - - -
-

1import numpy as np 

-

2import pandas as pd 

-

3 

-

4from arcade_collection.output.convert_model_units import convert_model_units 

-

5 

-

6 

-

7def convert_to_colorizer( 

-

8 all_data: pd.DataFrame, 

-

9 features: list[str], 

-

10 frame_spec: tuple[int, int, int], 

-

11 ds: float, 

-

12 dt: float, 

-

13 regions: list[str], 

-

14) -> dict: 

-

15 frames = list(np.arange(*frame_spec)) 

-

16 manifest = get_manifest_data(features, frames) 

-

17 

-

18 convert_model_units(all_data, ds, dt, regions) 

-

19 frame_data = all_data[all_data["TICK"].isin(frames)] 

-

20 

-

21 outliers = get_outliers_from_data(frame_data) 

-

22 tracks = get_tracks_from_data(frame_data) 

-

23 times = get_times_from_data(frame_data) 

-

24 

-

25 colorizer_json = { 

-

26 "manifest": manifest, 

-

27 "outliers": outliers, 

-

28 "tracks": tracks, 

-

29 "times": times, 

-

30 } 

-

31 

-

32 for feature in features: 

-

33 colorizer_json[feature] = get_feature_from_data(frame_data, feature) 

-

34 

-

35 return colorizer_json 

-

36 

-

37 

-

38def get_manifest_data(features: list[str], frames: list[int]) -> dict: 

-

39 manifest = { 

-

40 "frames": [f"frame_{i}.png" for i in range(len(frames))], 

-

41 "features": { 

-

42 feature: f"feature_{feature_index}.json" 

-

43 for feature_index, feature in enumerate(features) 

-

44 }, 

-

45 "outliers": "outliers.json", 

-

46 "tracks": "tracks.json", 

-

47 "times": "times.json", 

-

48 } 

-

49 

-

50 return manifest 

-

51 

-

52 

-

53def get_outliers_from_data(data: pd.DataFrame) -> dict: 

-

54 outliers = [False] * len(data) 

-

55 outliers_json = {"data": outliers, "min": False, "max": True} 

-

56 return outliers_json 

-

57 

-

58 

-

59def get_tracks_from_data(data: pd.DataFrame) -> dict: 

-

60 tracks = data["ID"] 

-

61 tracks_json = {"data": list(tracks)} 

-

62 return tracks_json 

-

63 

-

64 

-

65def get_times_from_data(data: pd.DataFrame) -> dict: 

-

66 times = data["time"] 

-

67 times_json = {"data": list(times)} 

-

68 return times_json 

-

69 

-

70 

-

71def get_feature_from_data(data: pd.DataFrame, feature: str) -> dict: 

-

72 feature_values = data[feature] 

-

73 feature_min = float(np.nanmin(feature_values)) 

-

74 feature_max = float(np.nanmax(feature_values)) 

-

75 

-

76 feature_json = {"data": list(feature_values), "min": feature_min, "max": feature_max} 

-

77 return feature_json 

-
- - - diff --git a/_coverage/d_0f042be92a388500_convert_to_contours_py.html b/_coverage/d_0f042be92a388500_convert_to_contours_py.html index d8aee0a..2fdccb9 100644 --- a/_coverage/d_0f042be92a388500_convert_to_contours_py.html +++ b/_coverage/d_0f042be92a388500_convert_to_contours_py.html @@ -2,7 +2,7 @@ - Coverage for src/arcade_collection/convert/convert_to_contours.py: 27% + Coverage for src/arcade_collection/convert/convert_to_contours.py: 100% @@ -12,7 +12,7 @@

Coverage for src/arcade_collection/convert/convert_to_contours.py: - 27% + 100%

- 26 statements   - - + 28 statements   + +

- « prev     + « prev     ^ index     » next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

- 50 statements   - - - + 73 statements   + + +

« prev     @@ -65,7 +65,7 @@

» next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

- 95 statements   - - - + 100 statements   + + +

« prev     @@ -65,7 +65,7 @@

» next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

- 26 statements   - - + 27 statements   + +

@@ -65,7 +65,7 @@

» next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

- 61 statements   - - - + 67 statements   + + +

« prev     @@ -65,7 +65,7 @@

» next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000

- 93 statements   - - - + 112 statements   + + +

« prev     ^ index     - » next + » next       coverage.py v7.1.0, - created at 2024-09-04 22:40 +0000 + created at 2024-09-18 21:10 +0000