Skip to content

Matching serialise/deserialise behaviours for units #391

@rafaqz

Description

@rafaqz

Discussed from #214 (comment) onwards. Making a separate issue so this is easier to find and track.

We should be able to serialise and deserialise units to strings - so e.g. that a table with a units column can be save and loaded again.The way of doing this suggested by @c42f is to make show output the raw julia version that uparse can read back into units. We would then add print methods and some REPL show methods that keep the current behaviour in normal use.

A PR for this would involve:

  • swapping current show methods to work with print
  • define show(::IO, ::MIME"text/plain", unit) so the REPL still looks ok.
  • write new show methods that return the raw julia version
  • write some tests for print/string/show behaviours

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions