Replies: 2 comments 1 reply
-
The generic form of the call would be with no arguments - the formats the adapters convert to/from have different features and constraints, and therefore the adapters have different features and arguments to their |
Beta Was this translation helpful? Give feedback.
-
Since the set of possible keyword arguments for each adapter is open-ended, and the set of adapters can be extended by plugin, it would be impossible to maintain consistency between these arguments across all adapters. So I think that code which passes these arguments in will need to know which adapter is being used, and pass only arguments that make sense. The adapters themselves should strive to work by default with no keyword arguments when possible. A different way to do this would be to pass one or more bundles of arguments, keyed by the adapter name. For example: `otio.adapters.write_to_file(timeline, {'aaf': { ... }, 'edl': { ... }, 'xml': { ... }})" so that defaults per-adapter could be passed in safely, but does this really improve the situation? Doesn't the caller know the filename and therefore the intended adapter already? |
Beta Was this translation helpful? Give feedback.
-
From
OpenTimelineIO/src/py-opentimelineio/opentimelineio/adapters/__init__.py
Line 137 in 45c6cfd
read_from_file()
->read_from_string()
through**adapter_argument_map
. However, the same kwargs are not accepted by all adapters (eg.rate, ignore_timecode_mismatch
is accepted in cmx_3600, but not in say, otio_json)If we try to pass defaults to
opentimelineio.adapters.read_from_file()
in an effort to keep the code generic (without detecting the file format), we getTypeError: read_from_string() got an unexpected keyword argument ignore_timecode_mismatch
I am a bit doubtful about whether this should be handled on the user end, or if
opentimelineio.adapters.read_from_file()
should handle it. Any opinions?Beta Was this translation helpful? Give feedback.
All reactions