enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.3k stars 284 forks source link

Rewrite RevPrefixMap to avoid depending on internal details of PrefixMap #1094

Closed mdickinson closed 2 years ago

mdickinson commented 2 years ago

The RevPrefixMap trait type subclasses PrefixMap and depends on its internals. PrefixMap wasn't designed for subclassing, and indeed changes in Traits 6.3 broke RevPrefixMap as a result. I'd recommend rewriting RevPrefixMap as a direct subclass of TraitType.

mdickinson commented 2 years ago

Temporary workaround in Traits: enthought/traits#1578.

mdickinson commented 2 years ago

@rahulporuri Could we aim to include a fix for this in the Mayavi 4.7.4 release, too? That would give Traits the freedom to remove its workaround.

The fix I'd propose would be to start by simply pasting the Traits 6.2.0 version of PrefixMap directly into tvtk_base, and then incrementally rewriting to collapse the RevPrefixMap -> PrefixMap -> TraitType inheritance chain to just RevPrefixMap -> TraitType. We'd need some basic unit tests for RevPrefixMap, of course.

rahulporuri commented 2 years ago

@mdickinson makes sense. added this to the 4.7.4 milestone for now.