LI3DS / cli-li3ds

CLI to interact with the LI³DS datastore through the LI³DS HTTP API
GNU General Public License v3.0
1 stars 0 forks source link

Dynamic transfo type ids #3

Closed mbredif closed 7 years ago

mbredif commented 7 years ago

Transfo types are currently hard coded

This could be centralised into a python object so that the transfo_type id is more explicit (by looking up transfo_type id by name), and so that this object could be populated dynamically using http://api.li3ds.io/transfos/types/.

elemoine commented 7 years ago

I am not sure I understand. Do you mind elaborating a bit?

mbredif commented 7 years ago

Instead of hard coding 'transfo_type': 1,, you could do 'transfo_type': transfo_type['affine'], where transfo_type is a dictionnary populated using /transfos/types/ endpoint of the li3ds api.

elemoine commented 7 years ago

Ok.

elemoine commented 7 years ago

@mbredif look at http://api.li3ds.io/transfos/types/. Transfo types have no names. This means that I have no key for the transfo_type dict mapping "transfo type names" (e.g. "affine") to "transfo type id". Do you agree that a "name" is required there as well?

mbredif commented 7 years ago

I think "func_name" should be renamed as "name". You can use func_name in the meantime.

elemoine commented 7 years ago

Oh ok, I thought the func signature did not include the actual func name. But I understand that it does… Thanks.

elemoine commented 7 years ago

Done with https://github.com/LI3DS/micmac_li3ds/commit/09ac27dc25fc2ccde47a65f1ac12ae9df958d705