Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature list ValueWizard #16

Open
20 of 26 tasks
Splines opened this issue Feb 14, 2024 · 2 comments
Open
20 of 26 tasks

Feature list ValueWizard #16

Splines opened this issue Feb 14, 2024 · 2 comments

Comments

@Splines
Copy link
Collaborator

Splines commented Feb 14, 2024

What we wish to have as features:

  • Res object to give our results: numerical value, error, unit,
  • Output customizable via global options (no TOML file instead global export config)
  • Multiple error values: systematic, statistical, and further
  • unit in siunitx
  • significant digits: if multiple errors are present: take the biggest error, let this one determine the number of digits of the main result, and display the other errors according to their own precision
  • manually specify number of significant digits (sigfigs), this overrides the logic of the program: usually it determines the number of decimal places based on the "error value", but with sigfigs specified, it will base this decision off the "main value"
  • globally import just like plt interface from matplotlib
  • allow pm in qty and arbitrary string such that we can do things like (1.0 +- 0.1) \cdot 10^2 -> outsource as much as possible to siunitx, use \num{..}; if we have to implement this on our own: allow internationalization for the $\cdot$ sign, e.g. use $\times$ in AE
  • resint, e.g. wiz.resint("i", i)
  • wizLaengeValueOnly, see Add option to additionally export variable without unit #11
  • Easily print results in python script #5 wiz.printByDefault() or wiz.res("laenge", 5, 0.01).print()
  • Allow easy disabling of rounding for one variable #7 turn rounding off for a variable -> current problem with this: we pass in values as floats and don't know how many digits they have; workaround: if user specifies number as string, then don't round that number, also for any number, e.g. errors
  • at first, we don't implement any tables at all
  • Possibility to use the generated string in the Python code #15 on result object: get_latex()
  • Add option to additionally export variable without unit #11 variable without unit: value only
  • wiz.export()
  • wiz.clear() as workaround for Cached globals in Jupyter notebook [low prio] #6
  • user faulty values -> output exception directly

Edit:

  • export a variable as latex code directly (e.g. copy to clipboard)
  • "no unit" usecase
  • do we assume usage of variable in math mode in latex?
  • \qty vs. \SI, especially assert compatibility with the physics package
  • Config options: automatic print with every res call. AND: option to automatically recreate the results.tex upon every res call.

TODO

  • publishing to pip
  • naming of lib
  • CI/CD, branch flow
@paul019
Copy link
Collaborator

paul019 commented Feb 14, 2024

Res(1.5, 0.1, r"\milli\meter")      # 1.50 +- 0.10

Res(0.0005, 0.1, r"\meter", autoprefix=True)    # 0.5 mm oder 500 um

Res(0.5, sys=0.1, stat=0.2)

Res(0.5, errors=[Error(0.2, "stat1"), Error(0.3, "stat2"), Error(0.4, "sys")])

Res(1.5, 0.1, r"\milli\meter", sigfigs=2)   # 1.5 +- 0.1

Res(1.5, 0.1, r"\milli\meter", decimal_places=2)    # 1.50 +- 0.10

vw.res("laenge", 1.5, r"\mm")

wiz.res("abw", 1.5, r"\sigma")

wiz.resint("i", i)

wiz.printByDefault()

@Splines
Copy link
Collaborator Author

Splines commented Feb 17, 2024

@paul019 What do you think? Do we want to allow that uncertainties can have units separated from the value? E.g. when an uncertainty is so small, you'd want to have "mm" instead of "m" just for the uncertainty. Is that a valid use case? It would definitely make the logic more complicated which is why I'm a bit reluctant right now.

Edit: we discussed this in person and came to the conclusion that this is not necessary. That is, we want uncertainties to be represented in the unit of the main value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants