Skip to content

Commit

Permalink
Added auto conversion and warning for integer input data. Resolved #30
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Deforce authored Jul 14, 2023
1 parent 484d064 commit ffb83af
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gutenTAG/base_oscillations/custom_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import numpy as np
import pandas as pd
import warnings

from . import BaseOscillation
from .interface import BaseOscillationInterface
Expand Down Expand Up @@ -88,6 +89,9 @@ def generate_only_base(self,

if len(df) < length:
raise ValueError("Number of rows in the input timeseries file is less than the desired length")
if df.dtypes[0] == 'int64':
df = df.astype(float)
warnings.warn("Input data was of integer type and has been automatically converted to float.")
return df.iloc[:length, 0]


Expand Down

0 comments on commit ffb83af

Please sign in to comment.