[kepler-users] Different behavior of an R script in R terminal and R actor of Kepler

Edward A. Lee eal at eecs.berkeley.edu
Wed Sep 5 20:31:56 PDT 2012


I think the reason for this is that the expression language
requires "." for the decimal point. The syntax uses "," to
separate elements of an array.

How do other languages deal with this?

Edward


On 9/5/12 5:34 PM, Christopher Brooks wrote:
> Hi Joseph M.,
> This could be an internationalization issue with Ptolemy II.
>
> ptolemy/actor/gui/ConfigurationApplication.java contains this code
>> // Even if the user is set up for foreign locale, use the US locale.
>>         // This is because certain parts of Ptolemy (like the expression
>>         // language) are not localized.
>>         // FIXME: This is a workaround for the locale problem, not a fix.
>>         // FIXME: In March, 2001, Johan Ecker writes
>>         // Ptolemy gave tons of exception when started on my laptop
>>         // which has Swedish settings as default. The Swedish standard
>>         // for floating points are "2,3", i.e. using a comma as
>>         // delimiter. However, I think most Swedes are adaptable and
>>         // do not mind using a dot instead since this more or less has
>>         // become the world standard, at least in engineering. The
>>         // problem is that I needed to change my global settings to
>>         // start Ptolemy and this is quite annoying. I guess that the
>>         // expression parser should just ignore the delimiter settings
>>         // on the local computer and always use dot, otherwise Ptolemy
>>         // will crash using its own init files.
>>         try {
>>             java.util.Locale.setDefault(java.util.Locale.US);
>>         } catch (java.security.AccessControlException accessControl) {
>>             // FIXME: If the application is run under Web Start, then
>> this
>>             // exception will be thrown.
>>         }
>
> The way I would approach this is to build Kepler using Eclipse and then
> try setting
> a different locale by editing the above code.
>
> I'm sorry Ptolemy II has this restriction, I find it somewhat embarrassing.
>
> For more about internationalization, see
> http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-dev/2010-July/018684.html
>
>
> The links on that message are out of date, see
> http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/2009-September/001082.html
>
>
> _Christopher
>
> On 9/5/12 3:24 AM, Josep Maria Campanera Alsina wrote:
>> Hi Derik,
>> I downloaded the Kepler 2.3 from
>> https://kepler-project.org/users/downloads and installed in a MAC OS
>> 10.7.4. The I installed the reporting module and that it. Kepler runs
>> nicely in my system.
>>
>> Thank you for your attention and let me know any progress on that.
>>
>> All the best,
>>
>> Josep M,
>>
>> 2012/9/5 Derik Barseghian <barseghian at nceas.ucsb.edu>:
>>> Hi Josep,
>>> Can you provide what operating system you're using, and if you're
>>> using a released version of kepler, or svn trunk?
>>> Thanks,
>>> Derik
>>>
>>> On Aug 30, 2012, at 2:47 AM, Josep Maria Campanera Alsina
>>> <campaxic at gmail.com> wrote:
>>>
>>>> Hi all,
>>>> I'm working with words with accents (like Artà or Església).
>>>>
>>>> My locale system is set properly as ca_ES.UTF-8 and when I launch R
>>>> from terminal it works nicely:
>>>>
>>>>> Sys.getlocale(category="LC_ALL")
>>>> [1] "ca_ES.UTF-8/ca_ES.UTF-8/ca_ES.UTF-8/C/ca_ES.UTF-8/ca_ES.UTF-8"
>>>>> municipi<-"Artà"
>>>>> municipi
>>>> [1] "Artà"
>>>>
>>>> But when I run the same script with R actor in Kepler 2.3 the behavior
>>>> changes unexpectedly
>>>>
>>>>> Sys.getlocale(category="LC_ALL")
>>>> [1] "C"
>>>>> municipi<-"Artà"
>>>>> municipi
>>>> [1] "Art\210"
>>>>
>>>> I've tried to fix the locale settings unsuccesfuly by means of:
>>>>
>>>> 1) run the following command at the beginning of my script:
>>>> Sys.setlocale(category="LC_CTYPE",locale="ca_ES.UTF-8"). Kepler stops
>>>> with an error.
>>>>
>>>> 2) edit ~/.Renviron and introduce LANG=ca_ES.UTF-8. Then Kepler stops
>>>> with initially at running the script.
>>>>
>>>> It seems that R actor  cannot work with locales different from "C"
>>>> since I've switched to en_US.UTF-8 and it doesn't work neither. Any
>>>> clue how to fix that? All comments welcome.
>>>>
>>>> Find attached the small workflow to test that.
>>>>
>>>> All the best,
>>>>
>>>> Josep Maria Campanera,
>>>> <testcampa.kar>_______________________________________________
>>>> Kepler-users mailing list
>>>> Kepler-users at kepler-project.org
>>>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 330 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20120905/917b2c0c/attachment.vcf>


More information about the Kepler-users mailing list