flightplotting 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (21) hide show
  1. {flightplotting-0.2.2/flightplotting.egg-info → flightplotting-0.2.4}/PKG-INFO +6 -4
  2. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/__init__.py +1 -1
  3. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/plots.py +33 -11
  4. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/traces.py +3 -12
  5. {flightplotting-0.2.2 → flightplotting-0.2.4/flightplotting.egg-info}/PKG-INFO +6 -4
  6. flightplotting-0.2.4/flightplotting.egg-info/requires.txt +6 -0
  7. {flightplotting-0.2.2 → flightplotting-0.2.4}/setup.cfg +6 -4
  8. flightplotting-0.2.2/flightplotting.egg-info/requires.txt +0 -4
  9. {flightplotting-0.2.2 → flightplotting-0.2.4}/COPYING +0 -0
  10. {flightplotting-0.2.2 → flightplotting-0.2.4}/MANIFEST.in +0 -0
  11. {flightplotting-0.2.2 → flightplotting-0.2.4}/README.md +0 -0
  12. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/data/ColdDraftF3APlane.obj +0 -0
  13. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/data/__init__.py +0 -0
  14. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/model.py +0 -0
  15. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/templates.py +0 -0
  16. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting/titlerenderer.py +0 -0
  17. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting.egg-info/SOURCES.txt +0 -0
  18. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting.egg-info/dependency_links.txt +0 -0
  19. {flightplotting-0.2.2 → flightplotting-0.2.4}/flightplotting.egg-info/top_level.txt +0 -0
  20. {flightplotting-0.2.2 → flightplotting-0.2.4}/setup.py +0 -0
  21. {flightplotting-0.2.2 → flightplotting-0.2.4}/tests/test_plots.py +0 -0
@@ -1,16 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightplotting
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Tools for Plotting Flight Data in Plotly
5
5
  Home-page: https://github.com/PyFlightCoach/FlightPlotting
6
6
  Author: Thomas David
7
7
  Author-email: thomasdavid0@gmail.com
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: COPYING
10
- Requires-Dist: setuptools
11
- Requires-Dist: flightdata
12
- Requires-Dist: pfc-geometry
10
+ Requires-Dist: numpy
11
+ Requires-Dist: pandas
13
12
  Requires-Dist: plotly
13
+ Requires-Dist: pfc-geometry>=0.2.4
14
+ Requires-Dist: flightdata>=0.2.6
15
+ Requires-Dist: flightanalysis>=0.2.6
14
16
 
15
17
  # FlightPlotting
16
18
 
@@ -1,4 +1,4 @@
1
1
 
2
2
 
3
3
  from flightplotting.plots import plotsec, plot_analysis, plotdtw, create_3d_plot, plot_regions
4
- from flightplotting.traces import axestrace, trace3d, dtwtrace, vector, vectors, boxtrace, axis_rate_traces, colour_from_scale
4
+ from flightplotting.traces import axestrace, trace3d, dtwtrace, vector, vectors, boxtrace, axis_rate_traces, colour_from_scale, get_colour
@@ -15,6 +15,7 @@ from flightplotting.traces import (
15
15
  )
16
16
 
17
17
  from flightdata import State
18
+ from flightdata.base.labeling import get_appended_id
18
19
  from geometry import Coord
19
20
  from flightplotting.model import obj, OBJ
20
21
  import numpy as np
@@ -99,23 +100,44 @@ def plotdtw(sec: State, manoeuvres: List[str], span=3, fig=None):
99
100
 
100
101
  return fig
101
102
 
102
- def plot_regions(st: State, lab_cols: list[str], span=3, colours=None, fig=None):
103
- if isinstance(lab_cols, str):
104
- lab_cols = [lab_cols]
105
- traces = []
106
- if colours is None:
107
- colours = px.colors.qualitative.Plotly
108
- for i, (k, seg) in enumerate(st.split_labels(lab_cols).items()):
109
- colour = colours[i % len(colours)]
110
- traces += ribbon(seg, span, colour, k)
103
+ def plot_regions(st: State, lab_cols: list[str], span=3, colours=None, fig=None, **kwargs):
104
+ colours = px.colors.qualitative.Plotly if colours is None else colours
105
+ lab_cols = [lab_cols] if isinstance(lab_cols, str) else lab_cols
106
+
111
107
 
108
+ st = st.label(clabs=st.cumulative_labels(*lab_cols))
109
+
110
+ def get_base_label(clab):
111
+ base = clab
112
+ try:
113
+ id = int(clab.split('_')[-1])
114
+ base = clab[:-len(f'_{id}')]
115
+ except Exception:
116
+ pass
117
+ return base
118
+
119
+ colmap = {}
120
+
121
+ traces = []
122
+ for i, (k, seg) in enumerate(st.split_labels('clabs').items()):
123
+ if len(seg) < 3:
124
+ continue
125
+ blab, id = get_appended_id(k)
126
+ if blab not in colmap:
127
+ colmap[blab] = colours[len(colmap) % len(colours)]
128
+ traces += ribbon(
129
+ seg, span, colmap[blab], name=blab,
130
+ showlegend=int(id)==0,
131
+ **kwargs[blab] if blab in kwargs else {}
132
+ )
112
133
  traces.append(go.Scatter3d(
113
134
  x=seg.pos.x,
114
135
  y=seg.pos.y,
115
136
  z=seg.pos.z,
116
137
  mode='lines',
117
- line=dict(width=6, color=colour),
118
- name=k
138
+ line=dict(width=0, color=colmap[blab]),
139
+ name=k,
140
+ showlegend=False
119
141
  ))
120
142
 
121
143
  if fig is None:
@@ -236,16 +236,8 @@ def _npinterzip(a, b):
236
236
  return c
237
237
 
238
238
 
239
- def ribbon(sec: State, span: float, color: str, name="none"):
240
- """WIP Vectorised version of ribbon, borrowed from kdoaij/FlightPlotting
241
-
242
- refactoring ribbon, objectives:
243
- speed it up by avoiding looping over array - done
244
- make the colouring more generic - not yet
245
- minor mod - 2 triangles per pair of points: - done
246
- current pair to next left
247
- current right to next pair
248
-
239
+ def ribbon(sec: State, span: float, color, **kwargs):
240
+ """TODO make the colouring more generic
249
241
  """
250
242
 
251
243
  left = sec.body_to_world(Point(0, span/2, 0))
@@ -262,10 +254,9 @@ def ribbon(sec: State, span: float, color: str, name="none"):
262
254
  _ks = np.array(range(2, len(points) -1 , 2))
263
255
  _k = _npinterzip(_ks, _ks) # 2 2 4 4 6 6
264
256
 
265
-
266
257
  return [go.Mesh3d(
267
258
  x=points.x, y=points.y, z=points.z, i=_i, j=_j, k=_k,
268
259
  intensitymode="cell",
269
260
  facecolor=np.full(len(_i), color),
270
- name=name,
261
+ **kwargs
271
262
  )]
@@ -1,16 +1,18 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightplotting
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Tools for Plotting Flight Data in Plotly
5
5
  Home-page: https://github.com/PyFlightCoach/FlightPlotting
6
6
  Author: Thomas David
7
7
  Author-email: thomasdavid0@gmail.com
8
8
  Description-Content-Type: text/markdown
9
9
  License-File: COPYING
10
- Requires-Dist: setuptools
11
- Requires-Dist: flightdata
12
- Requires-Dist: pfc-geometry
10
+ Requires-Dist: numpy
11
+ Requires-Dist: pandas
13
12
  Requires-Dist: plotly
13
+ Requires-Dist: pfc-geometry>=0.2.4
14
+ Requires-Dist: flightdata>=0.2.6
15
+ Requires-Dist: flightanalysis>=0.2.6
14
16
 
15
17
  # FlightPlotting
16
18
 
@@ -0,0 +1,6 @@
1
+ numpy
2
+ pandas
3
+ plotly
4
+ pfc-geometry>=0.2.4
5
+ flightdata>=0.2.6
6
+ flightanalysis>=0.2.6
@@ -5,15 +5,17 @@ author_email = thomasdavid0@gmail.com
5
5
  description = Tools for Plotting Flight Data in Plotly
6
6
  long_description = file: README.md
7
7
  long_description_content_type = text/markdown
8
- version = 0.2.2
8
+ version = 0.2.4
9
9
  url = https://github.com/PyFlightCoach/FlightPlotting
10
10
 
11
11
  [options]
12
12
  install_requires =
13
- setuptools
14
- flightdata
15
- pfc-geometry
13
+ numpy
14
+ pandas
16
15
  plotly
16
+ pfc-geometry>=0.2.4
17
+ flightdata>=0.2.6
18
+ flightanalysis>=0.2.6
17
19
  include_package_data = True
18
20
 
19
21
  [egg_info]
@@ -1,4 +0,0 @@
1
- setuptools
2
- flightdata
3
- pfc-geometry
4
- plotly
File without changes
File without changes
File without changes