Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #32

Merged
merged 2 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion torchcast/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.5.0'
__version__ = '0.5.1'
4 changes: 2 additions & 2 deletions torchcast/kalman_filter/binomial_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

from torchcast.covariance import Covariance
from torchcast.covariance.util import mini_cov_mask
from torchcast.internals.utils import identity
from torchcast.internals.utils import identity, class_or_instancemethod
from torchcast.kalman_filter import KalmanFilter
from torchcast.kalman_filter.ekf import EKFStep, EKFPredictions
from torchcast.process import Process
from torchcast.utils import conf2bounds, class_or_instancemethod
from torchcast.state_space.predictions import conf2bounds

if TYPE_CHECKING:
from pandas import DataFrame
Expand Down
3 changes: 2 additions & 1 deletion torchcast/kalman_filter/ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from torch import Tensor

from .kalman_filter import KalmanStep
from ..internals.utils import class_or_instancemethod
from ..state_space import Predictions
from ..utils import TimeSeriesDataset, class_or_instancemethod
from ..utils import TimeSeriesDataset


class EKFStep(KalmanStep):
Expand Down
6 changes: 5 additions & 1 deletion torchcast/state_space/predictions.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ def _tensor_to_df(tens, measures):
raise ValueError("Expected `type` to be 'predictions' or 'components'.")

out = pd.concat(out).reset_index(drop=True)
_out_cols = [group_colname, time_colname, 'measure', 'mean', 'lower', 'upper']
_out_cols = [group_colname, time_colname, 'measure', 'mean']
if conf is None:
_out_cols.append('std')
else:
_out_cols.extend(['lower', 'upper'])
if type.startswith('comp'):
_out_cols = _out_cols[0:3] + ['process', 'state_element'] + _out_cols[3:]
if 'actual' in out.columns:
Expand Down
Loading