miguelmoreto / pycomtrade

pyComtrade is a python module that provides you a transparent way for reading and writing oscillographic files in Comtrade format
http://pypi.python.org/pypi/pyComtrade
GNU General Public License v3.0
31 stars 30 forks source link

If the pathfile does not starts with ./ the program breaks #4

Closed ldemattos closed 7 years ago

ldemattos commented 7 years ago

Dear Miguel Moreto,

Thank you very much for this library to open comtrade files! You just made my life so much easier! You deserve an oscar!

Follows the issue description:

If the filepath for .cfg file don't starts with . the program breaks. Within the file example1.py change the line comtradeObj = pyComtrade.ComtradeRecord('./test_data3/test3.cfg') to comtradeObj = pyComtrade.ComtradeRecord('test_data3/test3.cfg') and you get No data file content. Use the method ReadDataFile first No data file content. Use the method ReadDataFile first Traceback (most recent call last): File "example1_l.py", line 66, in axarr[0].plot(time, AnalogChannelData) File "/usr/lib/python2.7/dist-packages/matplotlib/init.py", line 1814, in inner return func(ax, args, *kwargs) File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_axes.py", line 1424, in plot for line in self._get_lines(args, **kwargs): File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 386, in _grab_next_args for seg in self._plot_args(remaining, kwargs): File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 364, in _plot_args x, y = self._xy_from_xy(x, y) File "/usr/lib/python2.7/dist-packages/matplotlib/axes/_base.py", line 223, in _xy_from_xy raise ValueError("x and y must have same first dimension") ValueError: x and y must have same first dimension

I do have a proposal to correct the method ReadDataFile(), however I'm still struggling with git and github! ASAP, I'll do a pullrequest. I'm used to mercurial and bitbucket.

miguelmoreto commented 7 years ago

Hello, thanks for your contributions. Sorry to take so long to answer, but I didn't received any notification e-mail from github about your issues. Only today I received one when you added my name with @ like @ldemattos .

Did your solution works well? I just don't remember anymore why I used that ".".

I'm glad to know that this lib are usefull to someone!

Best regards,

Miguel

ldemattos commented 7 years ago

Hi @miguelmoreto !

I am the one who should say thanks here! You don't have idea how much your project is helping me!

Work well is a relative concept! LOL But it seems to be working fine. =)

I got so excited about your library that I even started the project http://github.com/ldemattos/openComtradeViewer ! I did put your name on about window =)

I hope that you accept my PR's or work with me to work around the issues since I don't have intention of keeping my own version of your library.

Best regards,

miguelmoreto commented 7 years ago

I accepted your PR! Nice idea the openComtradeViewer! I ended up making something simular for my ph. d. work but it is not good for releasing (it included analysis functions for my research) and the code is a mess. Best regards!

ldemattos commented 7 years ago

Cool =) I'm glad to help! =) Yeah, I'm using your library/openComtradeViewer to evaluate a method that I developing for msc thesis, as well. As far as I know there is not a comtrade reader for GNU/Linux, and those for windows really suck. Thanks again! Best regards!