Skip to content

Retriving a dumped module via "from_dump" function #41

@EnricoMariaFerrari

Description

@EnricoMariaFerrari

Describe the bug:

When I want to save an approximate module in my laptop, I need to use the function "dump()" to save the module. However, when I want to retrive such module, I have error: "a bytes-like object is required, not 'list'".

(Minimal) example:
This is an example of the code, where _s is a slicer:

import multipers as mp

mod = mp.module_approximation(_s)
dumped_mod = mod.dump()
new_mod = mp.mma_structures.from_dump_f64(dumped_mod )

which outputs

then the error about the last row of code:

File c:\Users\Enrico\AppData\Local\Programs\Python\Python311\Lib\site-packages\multipers\mma_structures.pyx:1011, in multipers.mma_structures.from_dump_f64()

File c:\Users\Enrico\AppData\Local\Programs\Python\Python311\Lib\site-packages\multipers\mma_structures.pyx:988, in multipers.mma_structures.cmod_from_dump_f64()

File c:\Users\Enrico\AppData\Local\Programs\Python\Python311\Lib\site-packages\multipers\mma_structures.pyx:968, in multipers.mma_structures.summand_from_dump_f64()

File <stringsource>:663, in View.MemoryView.memoryview_cwrapper()

File <stringsource>:353, in View.MemoryView.memoryview.__cinit__()

TypeError: a bytes-like object is required, not 'list'

Maybe my problem is stupid to solve, let me know it. Thank you very much!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions