rly / ndx-structured-behavior

An NWB extension for storing structured behavior programs and data, such as from BAABL/BEADL
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Deprection warnings due to use of positional arguments in Container classes #4

Closed oruebel closed 2 years ago

oruebel commented 2 years ago

Using the dev branch of HDMF I'm seeing the following deprecation warnings for most Container classes defined here (e.g,. the EventsTypesTable and ActionsTTypesTable).

Screen Shot 2022-07-15 at 11 39 05 AM

I'm not sure if this is an issue in the extension or whether the autogeneration of Container classes in HDMF needs to be updated to use positional arguments.

mavaylon1 commented 2 years ago

This is weird considering those are keyword args.

oruebel commented 2 years ago

This may not be an error in the extension code itself. It looks like those classes are autogenerated, so it may be that those arguments are somehow passed as positional arguments to the constructor of the parent class inside the autogenerated class. Since the warning refers to DynamicTable.__init__ as the parent class and not EventsTypeTable, this scenario seems likely. This warning was added in https://github.com/hdmf-dev/hdmf/pull/730 It may be that the class generator in HDMF need to be updated. @rly any idea?

mavaylon1 commented 2 years ago

So this is due to the docval in DynamicTable having a warning for args in the init and the check_args method in docval raises the warning. The only place I see args being used with DynamicTable.int is in the get_docval function, but that function only uses args. Thoughts? Does this mean we need to update get_docval to support kwargs? Screen Shot 2022-07-20 at 10 00 41 AM

rly commented 2 years ago

@mavaylon1 and I discussed this today. It relates to the use of call_docval_func. I raised this issue in HDMF https://github.com/hdmf-dev/hdmf/issues/748