[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2023-02-23 Thread I_is_chan
I_is_chan added a comment. In T119226#2412237 , @Tobias1984 wrote: > Here is some information of the range of values the API accepts: https://www.wikidata.org/wiki/Help:Statements#Quantitative_values > > We probably need more

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2022-08-22 Thread DD063520
DD063520 added a comment. Sorry, I'm not able to perform this task. I was not even aware it was assigned to me. TASK DETAIL https://phabricator.wikimedia.org/T119226 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: DD063520 Cc: Addshore,

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2020-02-16 Thread Xqt
Xqt added a comment. > PS: I add @Xqt because I guess you can help here Like matej_suchanek suggests please submit Patches to gerrit for reviewing. You may use Gerrit patch uploader if you don't want your own account there.

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2020-02-15 Thread matej_suchanek
matej_suchanek added a comment. My T204331 is probably a duplicate. > Should I submit this? Sure, reviews are better in Gerrit. There are two problems: - Pywikibot can loose precision when manipulating data - Pywikibot submits

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2020-02-14 Thread ArthurPSmith
ArthurPSmith added a comment. Sorry I never got around to looking at this further. @DD063520 do you understand the above comment from @thiemowmde about using the wbparsevalue api rather than python internals? TASK DETAIL https://phabricator.wikimedia.org/T119226 EMAIL PREFERENCES

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2020-02-14 Thread DD063520
DD063520 added a comment. Ok, I think I found a patch. We can changes this https://github.com/wikimedia/pywikibot/blob/2dfe67426c22c3c11cf9be0eabcf538f8848bd48/pywikibot/__init__.py#L847: def toWikibase(self): """ Convert the data to a JSON object for the

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-07-05 Thread ArthurPSmith
ArthurPSmith added a comment. Ok, that echoes something Tobias has said also about using strings and avoiding IEEE fp. I'm going to look at getting T112140 working first and then see if I can bring that implementation to bear on this.TASK DETAILhttps://phabricator.wikimedia.org/T119226EMAIL

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-07-04 Thread thiemowmde
thiemowmde added a comment. This limitation is not on input values. Use the wbparsevalue API, which is what the wikidata.org UI does and what https://www.wikidata.org/wiki/Help:Statements#Quantitative_values describes, and you can have all kinds of inputs. The resulting QuantityValue data

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-07-02 Thread ArthurPSmith
ArthurPSmith added a comment. That restriction is NOT in the JSON spec: http://tools.ietf.org/html/rfc7159.html#section-6 - also the leading plus is not required by JSON. Is there some other reason for the limitation in the wikidata code? DataValues is a wikidata-specific PHP library right? I

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-07-01 Thread ArthurPSmith
ArthurPSmith added a comment. Hmm. So is it a pywikibot problem or a wikibase API problem? Is pywikibot sending in JSON format?TASK DETAILhttps://phabricator.wikimedia.org/T119226EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: ArthurPSmithCc: thiemowmde,

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-07-01 Thread thiemowmde
thiemowmde added a comment. I believe what you do is constructing a JSON blob, and that is not allowed to have exponential representation, see https://github.com/DataValues/Number/blob/master/src/DataValues/DecimalValue.php#L43. When you use the parser it is allowed to have other formats, see

[Pywikipedia-bugs] [Maniphest] [Commented On] T119226: Very small (or very large) quantity values (represented in scientific notation) result in error in add/update via pywikibot/wikidata API

2016-06-27 Thread ArthurPSmith
ArthurPSmith added a comment. Please note this is still an issue with the latest pywikibot code and current wikidata release - as of June 23, 2016. The following is the fix I have in the pywikibot core pywikibot/__init__.py file: instead of format(value, "+g") we need: if math.fabs(value) <