hydra icon indicating copy to clipboard operation
hydra copied to clipboard

Add a Python coder

Open joshsh opened this issue 2 years ago • 3 comments

Prior to having an actual Hydra implementation in Python (#66), we will need a two-level Python coder (schemas and data/programs). This will be useful for Python functionality aimed at TinkerPop, for populating Jupyter notebooks with data and, for internal purposes at LinkedIn, etc.

joshsh avatar Apr 02 '23 21:04 joshsh

See https://github.com/CategoricalData/hydra/tree/feature-80-python.

joshsh avatar Apr 04 '23 14:04 joshsh

Note: at this time it is unclear what whether a schema encoding for Python is even meaningful, given that Python is schemaless. Meanwhile, the best data encoding for Python is simply JSON, which is already supported. Leaving this ticket open for now in case mapping of programs into Python becomes interesting in the medium- or long-term, which it is likely to.

joshsh avatar Nov 06 '23 13:11 joshsh

Actually... as of Python 3.7 (released almost five years ago), Python does have "dataclasses", which have a record-like syntax, e.g.

@dataclass
class Point:
     x: int
     y: int

These can probably serve as a target for many datatype definitions.

joshsh avatar Feb 12 '24 22:02 joshsh