flightplotting 0.2.6__tar.gz → 0.2.7__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 (29) hide show
  1. {flightplotting-0.2.6 → flightplotting-0.2.7}/PKG-INFO +4 -4
  2. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/plots.py +28 -8
  3. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/traces.py +8 -4
  4. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting.egg-info/PKG-INFO +4 -4
  5. flightplotting-0.2.7/flightplotting.egg-info/requires.txt +6 -0
  6. flightplotting-0.2.7/requirements.txt +6 -0
  7. flightplotting-0.2.6/flightplotting.egg-info/requires.txt +0 -6
  8. flightplotting-0.2.6/requirements.txt +0 -6
  9. {flightplotting-0.2.6 → flightplotting-0.2.7}/.github/workflows/publish_pypi.yml +0 -0
  10. {flightplotting-0.2.6 → flightplotting-0.2.7}/.gitignore +0 -0
  11. {flightplotting-0.2.6 → flightplotting-0.2.7}/.vscode/settings.json +0 -0
  12. {flightplotting-0.2.6 → flightplotting-0.2.7}/COPYING +0 -0
  13. {flightplotting-0.2.6 → flightplotting-0.2.7}/MANIFEST.in +0 -0
  14. {flightplotting-0.2.6 → flightplotting-0.2.7}/README.md +0 -0
  15. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/__init__.py +0 -0
  16. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/data/ColdDraftF3APlane.obj +0 -0
  17. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/data/__init__.py +0 -0
  18. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/model.py +0 -0
  19. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/templates.py +0 -0
  20. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting/titlerenderer.py +0 -0
  21. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting.egg-info/SOURCES.txt +0 -0
  22. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting.egg-info/dependency_links.txt +0 -0
  23. {flightplotting-0.2.6 → flightplotting-0.2.7}/flightplotting.egg-info/top_level.txt +0 -0
  24. {flightplotting-0.2.6 → flightplotting-0.2.7}/pyproject.toml +0 -0
  25. {flightplotting-0.2.6 → flightplotting-0.2.7}/setup.cfg +0 -0
  26. {flightplotting-0.2.6 → flightplotting-0.2.7}/tests/__init__.py +0 -0
  27. {flightplotting-0.2.6 → flightplotting-0.2.7}/tests/data/__init__.py +0 -0
  28. {flightplotting-0.2.6 → flightplotting-0.2.7}/tests/data/p23_flight.json +0 -0
  29. {flightplotting-0.2.6 → flightplotting-0.2.7}/tests/test_plots.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightplotting
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Tools for Plotting Flight Data in Plotly
5
5
  Author-email: Thomas David <thomasdavid0@gmail.com>
6
6
  License: GNU GPL v3
@@ -11,9 +11,9 @@ License-File: COPYING
11
11
  Requires-Dist: numpy
12
12
  Requires-Dist: pandas
13
13
  Requires-Dist: plotly
14
- Requires-Dist: pfc-geometry>=0.2.4
15
- Requires-Dist: flightdata>=0.2.6
16
- Requires-Dist: flightanalysis>=0.2.6
14
+ Requires-Dist: pfc-geometry>=0.2.8
15
+ Requires-Dist: flightdata>=0.2.16
16
+ Requires-Dist: flightanalysis>=0.2.17
17
17
 
18
18
  # FlightPlotting
19
19
 
@@ -17,35 +17,55 @@ from flightplotting.traces import (
17
17
  from flightdata import State
18
18
  from flightdata.base.labeling import get_appended_id
19
19
  from geometry import Coord
20
- from flightplotting.model import obj, OBJ
20
+ from flightplotting.model import obj
21
21
  import numpy as np
22
22
  from typing import List, Union
23
23
 
24
24
 
25
- def plotsec(secs: Union[State, list[State]], scale=5, nmodels=0, fig=None,
26
- color: Union[str, list[str]]=None, obj: OBJ=obj, cg=False, width=None,
25
+ def plotsec(secs: State | list[State] | dict[str, State], scale=5, nmodels=0, fig=None,
26
+ color: Union[str, list[str]]=None, cg=False, width=None,
27
27
  height=None, show_axes=False, ribb: bool=False, tips: bool=True, origin=False):
28
28
 
29
29
  traces = []
30
-
30
+ keys = None
31
31
  if isinstance(secs, State):
32
32
  secs = [secs]
33
33
 
34
+ if isinstance(secs, dict):
35
+ keys = list(secs.keys())
36
+ secs = list(secs.values())
37
+ showkeys=True
38
+ else:
39
+ keys = list(range(len(secs)))
40
+ showkeys=False
41
+
34
42
  for i, sec in enumerate(secs):
35
43
  text = ["{:.1f}".format(val) for val in sec.data.index]
36
44
  _color = color if color is not None else px.colors.qualitative.Plotly[i]
37
45
  if ribb:
38
- traces += ribbon(sec, scale * 1.85, _color)
46
+ traces += ribbon(sec, scale * 1.85, _color, name=keys[i])
39
47
  if tips:
40
- traces += tiptrace(sec, scale * 1.85, text=text)
48
+ traces += tiptrace(sec, scale * 1.85, text=text, name=keys[i])
41
49
  if nmodels > 0:
42
- traces += meshes(nmodels, sec, _color, obj.scale(scale))
50
+ traces += meshes(nmodels, sec, _color, scale)
43
51
  if cg:
44
- traces.append(cgtrace(sec, line=dict(color=_color, width=2)))
52
+ traces.append(cgtrace(sec, line=dict(color=_color, width=2), name=keys[i]))
45
53
 
46
54
  if origin:
47
55
  traces += axestrace(Coord.zero(), 50)
48
56
 
57
+ if showkeys:
58
+ for i, key in enumerate(keys):
59
+ traces.append(go.Scatter3d(
60
+ x=[],
61
+ y=[],
62
+ z=[],
63
+ mode='markers',
64
+ marker=dict(size=5, color=px.colors.qualitative.Plotly[i]),
65
+ name=key,
66
+ showlegend=True
67
+ ))
68
+
49
69
  if fig is None:
50
70
 
51
71
  fig = go.Figure(
@@ -24,14 +24,18 @@ def boxtrace():
24
24
  )]
25
25
 
26
26
 
27
- def meshes(npoints, seq: State, colour, obj: OBJ=obj):
27
+ def meshes(npoints, seq: State, colour, scale=1, _obj: OBJ=None):
28
+ _obj = obj if _obj is None else _obj
29
+ if scale != 1:
30
+ _obj = _obj.scale(scale)
28
31
  step = int(len(seq.data) / max(npoints, 1))
29
32
 
30
33
  ms = []
31
34
 
32
- sts = [seq[0]] + [ st for st in seq[::step]] + [seq[-1]]
33
- for st in sts:
34
- ms.append(obj.transform(Transformation(st.pos, st.att)).create_mesh(colour,f"{st.time.t[0]:.1f}"))
35
+ for st in seq[::step]:
36
+ ms.append(_obj.transform(
37
+ Transformation(st.pos, st.att)
38
+ ).create_mesh(colour,f"{st.time.t[0]:.1f}"))
35
39
  return ms
36
40
 
37
41
  def vector(origin, direction, **kwargs):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightplotting
3
- Version: 0.2.6
3
+ Version: 0.2.7
4
4
  Summary: Tools for Plotting Flight Data in Plotly
5
5
  Author-email: Thomas David <thomasdavid0@gmail.com>
6
6
  License: GNU GPL v3
@@ -11,9 +11,9 @@ License-File: COPYING
11
11
  Requires-Dist: numpy
12
12
  Requires-Dist: pandas
13
13
  Requires-Dist: plotly
14
- Requires-Dist: pfc-geometry>=0.2.4
15
- Requires-Dist: flightdata>=0.2.6
16
- Requires-Dist: flightanalysis>=0.2.6
14
+ Requires-Dist: pfc-geometry>=0.2.8
15
+ Requires-Dist: flightdata>=0.2.16
16
+ Requires-Dist: flightanalysis>=0.2.17
17
17
 
18
18
  # FlightPlotting
19
19
 
@@ -0,0 +1,6 @@
1
+ numpy
2
+ pandas
3
+ plotly
4
+ pfc-geometry>=0.2.8
5
+ flightdata>=0.2.16
6
+ flightanalysis>=0.2.17
@@ -0,0 +1,6 @@
1
+ numpy
2
+ pandas
3
+ plotly
4
+ pfc-geometry>=0.2.8
5
+ flightdata>=0.2.16
6
+ flightanalysis>=0.2.17
@@ -1,6 +0,0 @@
1
- numpy
2
- pandas
3
- plotly
4
- pfc-geometry>=0.2.4
5
- flightdata>=0.2.6
6
- flightanalysis>=0.2.6
@@ -1,6 +0,0 @@
1
- numpy
2
- pandas
3
- plotly
4
- pfc-geometry>=0.2.4
5
- flightdata>=0.2.6
6
- flightanalysis>=0.2.6
File without changes
File without changes
File without changes