Using scientific notation with high precision minieigenHP

Asked by Jérôme Duriez

Hi,

Trying to define e.g. a (1,0,0) Vector3 in YADE terminal with an increased numeric precision, the following works with yadedaily 20220321-6404~b30ea6a~focal1

import minieigenHP as mne
vec = mne.Vector3(1e0,0,0) # note the choice for a 1e0 notation
# but this does not give me an increased precision

On the other hand, the following does not work:

import minieigenHP as mne
vec = mne.HP2.Vector3(1e0,0,0) # we go now for HP2, while keeping the 1e0 notation

since I get: "RuntimeError: Unable to interpret input string as a floating point value"

Is that intended ?
If yes, is there a workflow you would advice to input numbers where scientific notation is useful ? (since I would prefer typing something like 1e-7 instead of 0.0000001)

Thanks (Janek ? ;-) )

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Janek Kozicki (cosurgi) said :
#2

Hm, I cannot reproduce this problem:

In [1]: import minieigenHP as mne

In [2]: mne.HP2.Vector3(1e0,0,0)
Out[2]: Vector3("1","0","0")

In [3]: mne.HP2.Vector3(1e-99,0,0)
Out[3]: Vector3("9.999999999999999999999999999999999252e-100","0","0")

I tried with 2022-03-18.git-31d72e5

Revision history for this message
Janek Kozicki (cosurgi) said :
#3

btw, sorry for late reply, I didn't notice this until I saw this expiration notice in the mailing list.

Revision history for this message
Janek Kozicki (cosurgi) said :
#4

Maybe it has got something to do with locales, like in https://gitlab.com/yade-dev/trunk/-/issues/254#note_877268706

Revision history for this message
Jérôme Duriez (jduriez) said :
#5

Updating locale LC_NUMERIC (from fr_FR.UTF-8 to en_US.UTF-8) solved the problem !

Thank you Janek (too bad you came late, I can not give you additional Launchpad Karma even though you "solved my question" ;-) )

Revision history for this message
Jérôme Duriez (jduriez) said :
#6

Answered post-expiration

Revision history for this message
Jérôme Duriez (jduriez) said :
#7

Actually solved