Skip to content

Commit

Permalink
fix: removing future warning in sp3 tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
seballgeyer committed Jul 26, 2024
1 parent 90a7a6f commit 2ce2eb6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions gnssanalysis/gn_io/sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ def getVelSpline(sp3Df: _pd.DataFrame) -> _pd.DataFrame:
sp3dfECI = sp3Df.EST.unstack(1)[["X", "Y", "Z"]] # _ecef2eci(sp3df)
datetime = sp3dfECI.index.get_level_values("J2000").values
spline = _interpolate.CubicSpline(datetime, sp3dfECI.values)
velDf = _pd.DataFrame(data=spline.derivative(1)(datetime), index=sp3dfECI.index, columns=sp3dfECI.columns).stack(1)
velDf = _pd.DataFrame(data=spline.derivative(1)(datetime), index=sp3dfECI.index, columns=sp3dfECI.columns).stack(
1, future_stack=True
)
return _pd.concat([sp3Df, _pd.concat([velDf], keys=["VELi"], axis=1)], axis=1)


Expand Down Expand Up @@ -309,7 +311,9 @@ def getVelPoly(sp3Df: _pd.DataFrame, deg: int = 35) -> _pd.DataFrame:

res_prev = coeff.T.dot(inputs_prev)
res_next = coeff.T.dot(inputs_next)
vel_i = _pd.DataFrame((((y - res_prev.T) + (res_next.T - y)) / 2), columns=est.columns, index=est.index).stack()
vel_i = _pd.DataFrame((((y - res_prev.T) + (res_next.T - y)) / 2), columns=est.columns, index=est.index).stack(
future_stack=True
)

vel_i.columns = [["VELi"] * 3] + [vel_i.columns.values.tolist()]

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sp3.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ def test_velinterpolation(self, mock_file):
"""
result = sp3.read_sp3("mock_path", pOnly=True)
r = sp3.getVelSpline(result)
r2 = sp3.getVelPoly(result, 3)
r2 = sp3.getVelPoly(result, 2)
self.assertIsNotNone(r)
self.assertIsNotNone(r2)

0 comments on commit 2ce2eb6

Please sign in to comment.