Skip to content

Symbols translation #1

@albop

Description

@albop

Variables, with optional time subscripts and indices should have three equivalent representations:

  1. object (example Symbol(name='β', subscripts=['i'], date=1)
  2. normalized string (example β__1__i)
  3. latex: (\beta_{i,t+1})

We can define the expected correspondences in https://github.com/EconForge/dolang/blob/master/tests/symbols.yaml .

We should define formally what arguments the objects accept

  • name: any valid python/julia identifier without a double underscore ?
  • date: signed integer (for now)
  • subscripts: list of names

As for the normalized string, initial proposal is: {}__{}__{}'.format(name, (str(date) if date>=0 else 'm'+str(date), str.join('_', subscripts)

So, currently, there is an implementation for 1.->2. under python only. I am not checking the tickbox though until we are sure about the definition/normalization.

[] python: 1.->2.
[] python: 1.->3.
[] python: 2.->1.
[] python: 3.->1. (not urgent)

[] julia: 1.->2.
[] julia: 1.->3.
[] julia: 2.->1.
[] julia: 3.->1. (not urgent)

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