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

Multiple uncertainties: print same number of digits #31

Open
Splines opened this issue Mar 27, 2024 · 2 comments · May be fixed by #46
Open

Multiple uncertainties: print same number of digits #31

Splines opened this issue Mar 27, 2024 · 2 comments · May be fixed by #46
Assignees
Labels
bug Something isn't working

Comments

@Splines
Copy link
Collaborator

Splines commented Mar 27, 2024

With the following code:

wiz.res("Wellenlänge", 5.4066e-7, 1.0297e-9, 3.6457e-9, r"\m")

will print to the console:

Wellenlaenge = (5.407 ± 0.010 (sys) ± 0.04 (stat))e-7 m

We end up with the following string in results.tex:

\qty{5.407 \pm 0.010\UncertSys \pm 0.04\UncertStat e-7}{\m}

This will show up in the document as
image

Note the additional 0 after the text "stat". The problem is that siunitx tries to show the same number of digits for systematic and statistical error, which I find a reasonable way of doing things.

@Splines Splines added the bug Something isn't working label Mar 27, 2024
@Splines
Copy link
Collaborator Author

Splines commented Mar 27, 2024

Note that a similar problem arises if I do

wavelength = 5.4066e-7
wavelength_err_sys = 1.0297e-9
wavelength_err_stat = 3.6457e-9
wiz.res("Wellenlänge", wavelength * 1e9,
        wavelength_err_sys*1e9, wavelength_err_stat * 1e9, r"\nm")

This will output to the console

Wellenlaenge = (540.7 ± 1.0 (sys) ± 4 (stat)) nm

and to the results.tex:

\qty{540.7 \pm 1.0\UncertSys \pm 4\UncertStat}{\nm}

which shows up as follows in the document:
image

@Splines
Copy link
Collaborator Author

Splines commented Apr 11, 2024

@paul019 Maybe, we can both take a look here if we find a solution to this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant