AIT-Core icon indicating copy to clipboard operation
AIT-Core copied to clipboard

Add extension capability to table and dtype

Open JimHofman opened this issue 3 years ago • 5 comments

Add the capability to extend Classes with table and dtype

JimHofman avatar Oct 18 '21 18:10 JimHofman

Working on a patch for dtype extensions support. Will have a PR up shortly for review

MJJoyce avatar Dec 15 '22 22:12 MJJoyce

It seems like extending CustomTypes requires python 3.10 or greater given the example code in the documentation. If so, this should be reflected in the install instructions.

class MyCustomTypes(dtype.CustomTypes):
    def get(self, typename: str) -> Optional[dtype.PrimitiveType]:
        match typename:
            case 'My24BitMSB':
                return My24BitMSB()

        return None

cswoodruff avatar Mar 28 '24 19:03 cswoodruff

Hey @cswoodruff, I'm guessing you're referencing the match in the example? Or something else and I'm just overlooking it? There's no "requirement" there beyond overwriting the interface.

MJJoyce avatar Mar 29 '24 15:03 MJJoyce

I was referring to the match in the example. It just caught me off guard because my virtualenv was running with python3.8 and I tried the example listed in the documentation and it failed.

cswoodruff avatar Mar 29 '24 17:03 cswoodruff

I was referring to the match in the example. It just caught me off guard because my virtualenv was running with python3.8 and I tried the example listed in the documentation and it failed.

Updated in 69ad7fe3abfd497e6ad989b10aa40f84137d093e

MJJoyce avatar Apr 01 '24 22:04 MJJoyce