kartik-hegde / mindmappings

A reference implementation of the Mind Mappings Framework.
MIT License
28 stars 8 forks source link

Perhaps incorrect data parsing in Python code #3

Open lingnickTang opened 1 year ago

lingnickTang commented 1 year ago

Hi,

After installing Timeloop, I executed the python3 costModel/timeloop/model_timeloop.py. However, I have noticed that the code is not working as expected, it threw ValueError: could not convert string to float: 'EDP(J*cycle):. And upon further inspection, I found that the positions of the data being parsed maybe swapped.

During debugging, I found the relative position of data is:

debug0

While the relevant lines of the code in mindmappings/costModel/timeloop/model_cnn.py#L250-L252:

cost.append(float(data[-24].split(" ")[-1]))
cost.append(float(data[-22].split(" ")[-2]))
cost.append(float(data[-23].split(" ")[-1]))

It seems that these three index number should be continuous. So I swaped the -22 and -23, and python did not raise error then.

Is it really a bug or do I miss anything?

blyucs commented 1 year ago

We encountered the same issue, which is due to the version of Timeloop. Please try Timeloop 1.0 version.

kartik-chipstack commented 1 year ago

The above is a poor design. It needs to be changed to parse XML/YAML, whichever timeloop dumps instead of that hacky script. If someone has a PR on it, happy to review