Git Product home page Git Product logo

Comments (7)

ratal avatar ratal commented on September 3, 2024

Hi,
For the first point, I will have a look and improve robustness.
Regarding the second point, it seems you try to read a file that is asking too much memory. You can try to use convertAfterRead=False parameter or ask to load only a set of channels you are interested in instead of the full file data.

from mdfreader.

stdkoehler avatar stdkoehler commented on September 3, 2024

Hey ratal, thanks for the input! I tried convertAfterRead=False which didn't help though. The error occurs before reaching line 1367 of mdf4reader where the boolean is checked:

        if convertAfterRead:
            self._convertAllChannel4()

is never reached.

I would like to try to load only a set of channels, which can be done via argument channelList = ['channel', 'list']. However, I don't know the data and am not sure what to put as "channel" or "list"

EDIT: I tried mdfreader.mdfinfo("./file.MF4").listChannels("./file.MF4") to get the channel names. However, I once again received a KeyError at mdfinfo4 line 990:
for cn in range(nChannel):

                if not toChangeIndex[cn]:
                    # offset all indexes of indexes to be moved
                    self['CNBlock'][dg][cg][cn + nChannel] = self['CNBlock'][dg][cg].pop(cn)
                    self['CCBlock'][dg][cg][cn + nChannel] = self['CCBlock'][dg][cg].pop(cn)

File "/Programme/anaconda/lib/python2.7/site-packages/mdfreader/mdfinfo4.py", line 990, in readCGBlock
self['CCBlock'][dg][cg][cn + nChannel] = self['CCBlock'][dg][cg].pop(cn)
KeyError: 1

from mdfreader.

ratal avatar ratal commented on September 3, 2024

Indeed documentation is maybe not so clear about channel listing. Below is the correct procedure:
from mdfreader.mdfinfo4 import info4
yop=info4()
yop.listChannels4('yourfile.mf4')
Looking a bit more deeply, there is possibility your file uses nested channel conversions. It was not so much tested so far (no file to experiment) and not really implemented.
It could then create a wrong representation of stored data and ask for too much data to be loaded ending with memory issues.
If you still have problem, best way would be to send an example of this file or at least a representation of its structure, like a info4 dict.

from mdfreader.

stdkoehler avatar stdkoehler commented on September 3, 2024

I still receive the same error as mentioned above, even if I use the approach you just described. I don't know whether the file is nested but it's possible. Sadly, I can't send you the data file as it is confidential from a project I work with several partners. A info4 dict might be possible though, if you tell me how I create it.

from mdfreader.

ratal avatar ratal commented on September 3, 2024

After thinking, it might be complicated for you and me to use this info4 dict. Instead, could you use mdfvalidator from vector (free use) and export as an xml the file structure ? It will help me to understand it.

from mdfreader.

ratal avatar ratal commented on September 3, 2024

2 feedback since 2 weeks, closed

from mdfreader.

swoldetsadick avatar swoldetsadick commented on September 3, 2024

I have the same issue but with a relatively small file 2,46 Mb. I would think it is a nested data format problem.
self['cc_ref'][i] = CCBlock(fid, self['cc_ref'][i])['name']['Comment']
does not exist.
self['cc_ref'][i] = CCBlock(fid, self['cc_ref'][i])['unit']['Comment'] does but I do not know if I should make the change.

from mdfreader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.