Message Boards Message Boards

2
|
5333 Views
|
5 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Why is this UnitConvert not converting?

EntityValue[Entity["Country", "UnitedStates"], EntityProperty["Country", "FreshwaterWithdrawals"]]

returns: enter image description here

POSTED BY: Luc Barthelet
5 Replies

I filed a bug .[CASE:4563074]

Good luck team!

Thank you Luc

POSTED BY: Luc Barthelet
Posted 4 years ago

Hi Mike,

I tried the code I posted on 12.1.1 and now it fails. I tried 12.0 and 12.1 and sometimes the first evaluation works but subsequent evaluations fail. Seems like a caching bug in the entity framework. To get it to reliably work on the first evaluation

Internal`ClearEntityValueCache["Country"];

but it will fail on subsequent evaluations.

@Luc Barthelet You should report this to WRI.

POSTED BY: Rohit Namjoshi
Posted 4 years ago

Rohit:

That is good news. But why would an entity return an invalid unevaluated UnitConvert?

POSTED BY: Mike Besso
Posted 4 years ago

The second argument to UnitConvert has to be just a unit specification. This works

w = EntityValue[Entity["Country", "UnitedStates"], EntityProperty["Country", "FreshwaterWithdrawals"]];

UnitConvert[w, "Giga" "Feet"^3/"Years"]
POSTED BY: Rohit Namjoshi
Posted 4 years ago

I get the same result. Looks like a bug.

Very interested in hearing the resolution. Thank you for bringing this up.

POSTED BY: Mike Besso
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract