Project

General

Profile

Actions

Bug #3962

closed

RExpression2 - support RecordTokens with length=1

Added by ben leinfelder about 15 years ago. Updated about 15 years ago.

Status:
Resolved
Priority:
Normal
Category:
actors
Target version:
Start date:
04/07/2009
Due date:
% Done:

0%

Estimated time:
Bugzilla-Id:
3962

Description

Ptolemy expression: {a = 1, b = "b", c = 3}
results in a conversion error when going from Token->Java/R

Actions #1

Updated by Derik Barseghian about 15 years ago

Hmm, this looks familiar. I think I fixed this, or something similar in the original RExpression actor. Not sure if that's in anyway helpful for RExpression2, but if so, grep your mail for "No longer ignore recordtokens with length 1 in conversion to dataframe.", a cvs commit on April 25, 2008 to see the relevant section.

Actions #2

Updated by ben leinfelder about 15 years ago

I can see in the RExpression2 code that I'm assuming RecordTokens contain ArrayTokens. But when there's only one Token, there's a class cast exception (duh).

Actions #3

Updated by ben leinfelder about 15 years ago

RExpression2 actor now accepts the length=1 RecordToken, but slightly mutates the structure during the conversion.
Ptolemy -> JRI -> Ptolemy results in the following Token: {a = {1}, b = "b", c = {3}}
Notice that the the numeric tokens (a and c) are now lists, whereas the string token is a single token.
JRI only assigns numeric values using arrays of them. Even treating the String as a String[] doesn't force "b" to be a list - this seems like a JRI limitation.

I think we can live with what's returned. The alternative is to treat the numbers as strings so that it's a uniform data structure.

Subsequent passes through multiple RExpression2 actors preserves the data structure as such: {a = {1}, b = "b", c = {3}}
so at least it's predictable from that standpoint.

Actions #4

Updated by Redmine Admin about 11 years ago

Original Bugzilla ID was 3962

Actions

Also available in: Atom PDF