Skip to content

Allow "dot" notation for variables #88

Description

@jcrivenaes

Currently we need to access variables as dicts, e.g.

if cfg["SOME"]["OTHER"]["FACIES_NAME"] == "whatever":
    ...

It will be more readable and less cluttered to be able to access these with a .dot notation in addition:

if cfg.SOME.OTHER.FACIES_NAME == "whatever":
    ...

There are two obstackles here though, we cannot use reserved words (e.g. global) or integers as dot keys. A solution with be to make underscores

Hence these two shall be equivalent (and both shall be allowed at the same time)

cfg["global"]["SOME"]["OTHER"]["FACIES_NAME"][0]["COMMENT"]

cfg._global_.SOME.OTHER.FACIES_NAME._0_.COMMENT

Metadata

Metadata

Assignees

Labels

postponedE.g. a bug not urgent, postponed for various reasons

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions