flightdata 0.2.2__tar.gz → 0.2.3__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 (33) hide show
  1. {flightdata-0.2.2 → flightdata-0.2.3}/PKG-INFO +1 -1
  2. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/base/__init__.py +1 -1
  3. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/base/collection.py +4 -4
  4. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/base/table.py +3 -32
  5. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/environment/environment.py +2 -2
  6. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/flow.py +2 -2
  7. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/model/aerodynamic.py +1 -1
  8. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/state.py +5 -5
  9. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata.egg-info/PKG-INFO +1 -1
  10. {flightdata-0.2.2 → flightdata-0.2.3}/setup.cfg +1 -1
  11. {flightdata-0.2.2 → flightdata-0.2.3}/LICENSE +0 -0
  12. {flightdata-0.2.2 → flightdata-0.2.3}/README.md +0 -0
  13. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/__init__.py +0 -0
  14. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/base/constructs.py +0 -0
  15. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/base/numpy_encoder.py +0 -0
  16. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/coefficients.py +0 -0
  17. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/environment/__init__.py +0 -0
  18. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/environment/wind.py +0 -0
  19. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/flight/__init__.py +0 -0
  20. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/flight/ardupilot.py +0 -0
  21. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/flight/fields.py +0 -0
  22. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/flight/flight.py +0 -0
  23. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/model/__init__.py +0 -0
  24. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/model/thrust.py +0 -0
  25. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata/origin.py +0 -0
  26. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata.egg-info/SOURCES.txt +0 -0
  27. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata.egg-info/dependency_links.txt +0 -0
  28. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata.egg-info/requires.txt +0 -0
  29. {flightdata-0.2.2 → flightdata-0.2.3}/flightdata.egg-info/top_level.txt +0 -0
  30. {flightdata-0.2.2 → flightdata-0.2.3}/setup.py +0 -0
  31. {flightdata-0.2.2 → flightdata-0.2.3}/test/test_fields.py +0 -0
  32. {flightdata-0.2.2 → flightdata-0.2.3}/test/test_flight.py +0 -0
  33. {flightdata-0.2.2 → flightdata-0.2.3}/test/test_origin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightdata
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Module for handling UAV flight log data
5
5
  Home-page: https://github.com/PyFlightCoach/FlightData
6
6
  Author: Thomas David
@@ -1,4 +1,4 @@
1
- from .table import Time, Table, Constructs, SVar
1
+ from .table import Table, Constructs, SVar
2
2
  from .collection import Collection
3
3
  from .numpy_encoder import NumpyEncoder
4
4
 
@@ -48,11 +48,11 @@ class Collection:
48
48
  def to_list(self) -> List[T]:
49
49
  return list(self.data.values())
50
50
 
51
- def to_dicts(self) -> list[dict[str, Any]]:
52
- return [v.to_dict() for v in self.data.values()]
51
+ def to_dicts(self, *args, **kwargs) -> list[dict[str, Any]]:
52
+ return [v.to_dict(*args, **kwargs) for v in self.data.values()]
53
53
 
54
- def to_dict(self) -> dict[str, dict[str, Any]]:
55
- return {k: v.to_dict() for k, v in self.data.items()}
54
+ def to_dict(self, *args, **kwargs) -> dict[str, dict[str, Any]]:
55
+ return {k: v.to_dict(*args, **kwargs) for k, v in self.data.items()}
56
56
 
57
57
  @classmethod
58
58
  def from_dicts(cls, vals: list[dict[str: Any]]) -> Self:
@@ -2,44 +2,13 @@ from __future__ import annotations
2
2
  import numpy as np
3
3
  import pandas as pd
4
4
  import numpy.typing as npt
5
- from geometry import Base, Point, Quaternion, Transformation
5
+ from geometry import Base, Time
6
6
  from typing import Union, Self, Tuple
7
7
  from .constructs import SVar, Constructs
8
8
  from numbers import Number
9
-
10
9
  from time import time
11
10
 
12
11
 
13
- class Time(Base):
14
- cols=["t", "dt"]
15
-
16
- @staticmethod
17
- def from_t(t: np.ndarray) -> Self:
18
- if isinstance(t, Number):
19
- return Time(t, 1/30)
20
- else:
21
- dt = np.array([1/30]) if len(t) == 1 else np.gradient(t)
22
- return Time(t, dt)
23
-
24
- def scale(self, duration) -> Self:
25
- old_duration = self.t[-1] - self.t[0]
26
- sfac = duration / old_duration
27
- return Time(
28
- self.t[0] + (self.t - self.t[0]) * sfac,
29
- self.dt * sfac
30
- )
31
-
32
- def reset_zero(self):
33
- return Time(self.t - self.t[0], self.dt)
34
-
35
- @staticmethod
36
- def now():
37
- return Time.from_t(time())
38
-
39
- def extend(self):
40
- return Time.concatenate([self, Time(self.t[-1] + self.dt[-1], self.dt[-1])])
41
-
42
-
43
12
  def make_time(tab):
44
13
  return Time.from_t(tab.t)
45
14
 
@@ -94,6 +63,8 @@ class Table:
94
63
 
95
64
  @classmethod
96
65
  def from_dict(Cls, data):
66
+ if ['data'] in data:
67
+ data = data['data']
97
68
  return Cls(pd.DataFrame.from_dict(data).set_index("t", drop=False))
98
69
 
99
70
  def __len__(self):
@@ -1,6 +1,6 @@
1
1
 
2
- from flightdata import Flight, Constructs, SVar, Table, Origin, Time
3
- from geometry import Point, Base, P0
2
+ from flightdata import Flight, Constructs, SVar, Table, Origin
3
+ from geometry import Point, Base, P0, Time
4
4
  import numpy as np
5
5
  from .wind import WindModel, WindModelBuilder
6
6
 
@@ -1,6 +1,6 @@
1
1
 
2
- from flightdata import Table, Time, SVar, Constructs, SVar, Flight, Origin
3
- from geometry import Point, Base, PX, Euler
2
+ from flightdata import Table, SVar, Constructs, SVar, Flight, Origin
3
+ from geometry import Point, Base, PX, Euler, Time
4
4
  import numpy as np
5
5
 
6
6
 
@@ -1,5 +1,5 @@
1
1
  '''Take a flow and a controls, return the aerodynamic forces and moments'''
2
- from flightdata import Time, Coefficients
2
+ from flightdata import Coefficients
3
3
  from . import Model
4
4
  import numpy as np
5
5
  import geometry as g
@@ -6,7 +6,7 @@ import numpy as np
6
6
  import pandas as pd
7
7
  from pandas.api.types import is_list_like
8
8
  import geometry as g
9
- from flightdata import Table, Constructs, SVar, Time, Origin, Flow, Environment
9
+ from flightdata import Table, Constructs, SVar, Origin, Flow, Environment
10
10
 
11
11
 
12
12
  class State(Table):
@@ -33,7 +33,7 @@ class State(Table):
33
33
  if transform is None:
34
34
  transform = g.Transformation()
35
35
  if not "time" in kwargs:
36
- kwargs["time"] = Time.from_t(np.linspace(0, State._construct_freq*len(transform), len(transform)))
36
+ kwargs["time"] = g.Time.from_t(np.linspace(0, State._construct_freq*len(transform), len(transform)))
37
37
  return State.from_constructs(pos=transform.p, att=transform.q, **kwargs)
38
38
 
39
39
  def body_to_world(self, pin: g.Point, rotation_only=False) -> g.Point:
@@ -56,7 +56,7 @@ class State(Table):
56
56
  else:
57
57
  return self.back_transform.g.Point(pin)
58
58
 
59
- def fill(self, time: Time) -> State:
59
+ def fill(self, time: g.Time) -> State:
60
60
  '''Project forward through time assuming small angles and uniform circular motion'''
61
61
  st = self[-1]
62
62
  vel = st.vel.tile(len(time))
@@ -73,7 +73,7 @@ class State(Table):
73
73
  """Extrapolate the input state assuming uniform circular motion and small angles
74
74
  """
75
75
  npoints = np.max([int(np.ceil(duration / self.dt[0])), min_len])
76
- time = Time.from_t(np.linspace(0,duration, npoints))
76
+ time = g.Time.from_t(np.linspace(0,duration, npoints))
77
77
  return self.fill(time)
78
78
 
79
79
  @staticmethod
@@ -101,7 +101,7 @@ class State(Table):
101
101
  elif origin is None:
102
102
  origin = flight.origin
103
103
 
104
- time = Time.from_t(np.array(flight.data.time_flight))
104
+ time = g.Time.from_t(np.array(flight.data.time_flight))
105
105
 
106
106
  if all(flight.contains('gps')) and flight.primary_pos_source == 'gps':
107
107
  pos = origin.rotation.transform_point(g.GPS(flight.gps) - origin.pos[0])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flightdata
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Module for handling UAV flight log data
5
5
  Home-page: https://github.com/PyFlightCoach/FlightData
6
6
  Author: Thomas David
@@ -5,7 +5,7 @@ author_email = thomasdavid0@gmail.com
5
5
  description = Module for handling UAV flight log data
6
6
  long_description = file: README.md
7
7
  long_description_content_type = text/markdown
8
- version = 0.2.2
8
+ version = 0.2.3
9
9
  url = https://github.com/PyFlightCoach/FlightData
10
10
 
11
11
  [options]
File without changes
File without changes
File without changes