michaelbosello / battery-rul-estimation Goto Github PK
View Code? Open in Web Editor NEWRemaining Useful Life (RUL) estimation of Lithium-ion batteries using deep LSTMs
License: Apache License 2.0
Remaining Useful Life (RUL) estimation of Lithium-ion batteries using deep LSTMs
License: Apache License 2.0
train_data_test_names = [
'000-DM-3.0-4019-S',
'001-DM-3.0-4019-S',
'002-DM-3.0-4019-S',
'006-EE-2.85-0820-S',
'007-EE-2.85-0820-S',
'018-DP-2.00-1320-S',
'019-DP-2.00-1320-S',
'036-DP-2.00-1720-S',
'037-DP-2.00-1720-S',
'038-DP-2.00-2420-S',
'040-DM-4.00-2320-S',
'042-EE-2.85-0820-S',
'045-BE-2.75-2019-S'
]
test_data_test_names = [
'003-DM-3.0-4019-S',
'008-EE-2.85-0820-S',
'039-DP-2.00-2420-S',
'041-DM-4.00-2320-S',
]
dataset.prepare_data(train_data_test_names, test_data_test_names)
Error:
ZeroDivisionError Traceback (most recent call last)
in ()
22 ]
23
---> 24 dataset.prepare_data(train_data_test_names, test_data_test_names)
1 frames
/content/drive/My Drive/battery-state-estimation/battery-state-estimation/data_processing/unibo_powertools_data.py in prepare_data(self, train_names, test_names)
218
219 self.train_discharge_cyc = self.__add_discharge_soc_pars(
--> 220 self.train_discharge_cyc, self.train_charge_cap
221 )
222 self.test_discharge_cyc = self.__add_discharge_soc_pars(
/content/drive/My Drive/battery-state-estimation/battery-state-estimation/data_processing/unibo_powertools_data.py in __add_discharge_soc_pars(self, discharge_cyc, charge_cap)
311 np.zeros(discharge_cyc[i].shape[0])]
312 discharge_cyc[i][:, -1] = (charge_cap[i][CapacityCols.CHARGING_CAPACITY] - discharge_cyc[i]
--> 313 [:, CycleCols.DISCHARGING_CAPACITY]) / charge_cap[i][CapacityCols.CHARGING_CAPACITY]
314
315 # Time remaining to cycle end: (Time of last row in cycle - current time)
ZeroDivisionError: float division by zero
Hi, thanks for sharing this great work. The paper and code have inspired me a lot.
I want to reproduce your result, so i would like to ask what version of tensorflow you used in this code? thanks in advance
dataset = UniboPowertoolsData(
test_types=[],
chunk_size=1000000,
lines=[37, 40],
charge_line=37,
discharge_line=40,
base_path="data/unibo-powertools-dataset/unibo-powertools-dataset/test_result.csv"
)
error:
FileNotFoundError Traceback (most recent call last)
Input In [13], in <cell line: 1>()
----> 1 dataset = UniboPowertoolsData(
2 test_types=[],
3 chunk_size=1000000,
4 lines=[37, 40],
5 charge_line=37,
6 discharge_line=40,
7 base_path="Desktop/battery unibo/battery-rul-estimation-main/battery-rul-estimation/data/unibo-powertools-dataset/unibo-powertools-dataset/test_result.csv"
8 )
File ~\Desktop\battery unibo\battery-rul-estimation-main\battery-rul-estimation\experiments\unibo-powertools../..\data_processing\unibo_powertools_data.py:79, in UniboPowertoolsData.init(self, test_types, chunk_size, lines, charge_line, discharge_line, base_path)
76 self.cyc_path = base_path + TEST_RESULT_DATA_PATH
77 self.cap_path = base_path + TEST_RESULT_TRIAL_END_DATA_PATH
---> 79 self.__load_raw_data()
File ~\Desktop\battery unibo\battery-rul-estimation-main\battery-rul-estimation\experiments\unibo-powertools../..\data_processing\unibo_powertools_data.py:82, in UniboPowertoolsData.__load_raw_data(self)
81 def __load_raw_data(self):
---> 82 self.__load_csv_to_raw()
83 self.__clean_cycle_raw()
84 self.__clean_capacity_raw()
File ~\Desktop\battery unibo\battery-rul-estimation-main\battery-rul-estimation\experiments\unibo-powertools../..\data_processing\unibo_powertools_data.py:92, in UniboPowertoolsData.__load_csv_to_raw(self)
88 def __load_csv_to_raw(self):
89 self.logger.debug("Start loading data with lines: %s, types: %s and chunksize: %s..." %
90 (self.lines, self.test_types, self.chunksize))
---> 92 iter_cyc = pd.read_csv(
93 self.cyc_path, chunksize=self.chunksize, iterator=True)
94 self.cycle_raw = pd.concat(self.__filter_raw_chunk(iter_cyc))
96 iter_cap = pd.read_csv(
97 self.cap_path, chunksize=self.chunksize, iterator=True)
File ~\anaconda3\lib\site-packages\pandas\util_decorators.py:311, in deprecate_nonkeyword_arguments..decorate..wrapper(*args, **kwargs)
305 if len(args) > num_allow_args:
306 warnings.warn(
307 msg.format(arguments=arguments),
308 FutureWarning,
309 stacklevel=stacklevel,
310 )
--> 311 return func(*args, **kwargs)
File ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:680, in read_csv(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)
665 kwds_defaults = _refine_defaults_read(
666 dialect,
667 delimiter,
(...)
676 defaults={"delimiter": ","},
677 )
678 kwds.update(kwds_defaults)
--> 680 return _read(filepath_or_buffer, kwds)
File ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:575, in _read(filepath_or_buffer, kwds)
572 _validate_names(kwds.get("names", None))
574 # Create the parser.
--> 575 parser = TextFileReader(filepath_or_buffer, **kwds)
577 if chunksize or iterator:
578 return parser
File ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:933, in TextFileReader.init(self, f, engine, **kwds)
930 self.options["has_index_names"] = kwds["has_index_names"]
932 self.handles: IOHandles | None = None
--> 933 self._engine = self._make_engine(f, self.engine)
File ~\anaconda3\lib\site-packages\pandas\io\parsers\readers.py:1217, in TextFileReader._make_engine(self, f, engine)
1213 mode = "rb"
1214 # error: No overload variant of "get_handle" matches argument types
1215 # "Union[str, PathLike[str], ReadCsvBuffer[bytes], ReadCsvBuffer[str]]"
1216 # , "str", "bool", "Any", "Any", "Any", "Any", "Any"
-> 1217 self.handles = get_handle( # type: ignore[call-overload]
1218 f,
1219 mode,
1220 encoding=self.options.get("encoding", None),
1221 compression=self.options.get("compression", None),
1222 memory_map=self.options.get("memory_map", False),
1223 is_text=is_text,
1224 errors=self.options.get("encoding_errors", "strict"),
1225 storage_options=self.options.get("storage_options", None),
1226 )
1227 assert self.handles is not None
1228 f = self.handles.handle
File ~\anaconda3\lib\site-packages\pandas\io\common.py:789, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
784 elif isinstance(handle, str):
785 # Check whether the filename is to be opened in binary mode.
786 # Binary mode does not support 'encoding' and 'newline'.
787 if ioargs.encoding and "b" not in ioargs.mode:
788 # Encoding
--> 789 handle = open(
790 handle,
791 ioargs.mode,
792 encoding=ioargs.encoding,
793 errors=errors,
794 newline="",
795 )
796 else:
797 # Binary mode
798 handle = open(handle, ioargs.mode)
FileNotFoundError: [Errno 2] No such file or directory: 'Desktop/battery unibo/battery-rul-estimation-main/battery-rul-estimation/data/unibo-powertools-dataset/unibo-powertools-dataset/test_result.csvdata/unibo-powertools-dataset/unibo-powertools-dataset/test_result.csv'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.