Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write function fails at writer._frames[0] #32

Closed
mjhmilla opened this issue May 27, 2021 · 2 comments
Closed

write function fails at writer._frames[0] #32

mjhmilla opened this issue May 27, 2021 · 2 comments

Comments

@mjhmilla
Copy link

mjhmilla commented May 27, 2021

The write function fails when calling 'self._frames[0] complaining that Writer has no attribute frame. Here are some details

Minimal example of the problem:

`import numpy as np
import c3d

inputFileName = 'P02_FL_Con_2FP_noGapFill.c3d'

reader = c3d.Reader(open(inputFileName, 'rb'))
writer = c3d.Writer( reader.point_rate,
reader.analog_rate,
reader.point_scale,
'mm',
1.0)

writer.add_frames(reader.read_frames())

with open('output.c3d','wb') as h:
writer.write(h,reader.point_labels)
h.close()`

Traceback (most recent call last):
File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
main, mod_spec)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/mjhmilla/.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/main.py", line 45, in
cli.main()
File "/home/mjhmilla/.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 444, in main
run()
File "/home/mjhmilla/.vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/../debugpy/server/cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "/usr/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/data/projects/AutomatedMocapGapFill/Gap_Fill_Python_code/minimalWorkingExample.py", line 15, in
points,analog=writer._frame[0]
AttributeError: 'Writer' object has no attribute '_frame'

@AKuederle
Copy link
Collaborator

Could you please check if the issue still occures with the current version?

@AKuederle
Copy link
Collaborator

As #43 is merged now, I assume this is fixed. If not please repopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants