Skip to content

Commit

Permalink
Results: Fix default dataclass member in FixResult for python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
lucianolorenti committed Oct 8, 2023
1 parent 97d81f5 commit 3f51bbc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8']
python-version: [ '3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion ceruleo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
CACHE_PATH.mkdir(parents=True, exist_ok=True)


__version__ = "2.0.5"
__version__ = "2.0.6"
5 changes: 3 additions & 2 deletions ceruleo/results/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"""
import logging
from dataclasses import dataclass
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple, Union

import numpy as np
Expand Down Expand Up @@ -56,14 +56,15 @@ class PredictionResult:
name: str
true_RUL: np.ndarray
predicted_RUL: np.ndarray
metrics: MetricsResult = MetricsResult(0, 0)
metrics: MetricsResult

def compute_metrics(self):
self.metrics.mae = mae(self.true_RUL, self.predicted_RUL)
self.metrics.mse = mse(self.true_RUL, self.predicted_RUL)


def __init__(self, name:str, true_RUL: np.ndarray, predicted_RUL: np.ndarray):
self.metrics = MetricsResult(0, 0)
self.name = name
self.true_RUL = np.squeeze(true_RUL)
self.predicted_RUL = np.squeeze(predicted_RUL)
Expand Down

0 comments on commit 3f51bbc

Please sign in to comment.