Re: [Radiance-dev] Python scripts for Radiance

2016-04-04 Thread Georg Mischler
Hi Wouter, such "interactive" scripts present a special challenge. I made an experiment with this one, and you'll find the resulting glaze.py on GitHub. The user interface works a bit different than in the original, but I'm sure you'll figure it out. Automatic testing is difficult here, so I did

Re: [Radiance-dev] Python scripts for Radiance

2016-03-25 Thread Georg Mischler
Am 2016-03-24 17:58, schrieb Gregory J. Ward: Does rlux even work under Windows? I suppose it does, or you wouldn't bother. Also, where does this program exit? How does it return an error if it doesn't get at least two arguments? Shouldn't there be a call to os.exit(1) after the print call?

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Randolph M. Fritz
import os import sys import math import tempfile import argparse import subprocess ​On Unix, os, sys, and math are mostly wrappers around libraries familiar to you; on Windows, they are often very close in functionality. I don't expect they would be much trouble to your. Tempfile is a little bit m

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Randolph M. Fritz
My impression is that Python has become something of a standard in the research community, with tools like SciPy, NumPy, and SAGE widely used, though Perl has a library comparable to NumPy in PDL, and there is a SciRuby, There is nothing else like SAGE except for the commercial packages Mathematica

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Gregory J. Ward
rcalc working on header-less input, so those are the places to look out for in the workflow. In some cases, we may be able to reformulate things to use rmtxop or add an option to rcalc for number of i/o records. -Greg > From: "Guglielmetti, Robert" > Subject: Re: [Radiance-de

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Guglielmetti, Robert
File under "my $0.02": On 3/24/16, 12:28 AM, "Georg Mischler" wrote: > >Today, another added benefit is the large pool of people who know how >to work with it (probably larger than Perl and Ruby together). >Ruby has many similarities with Python (not sure about its library), but >in comparison it

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Gregory J. Ward
Hi Schorsch, Thanks for your responses. More inline... > From: Georg Mischler > Subject: Re: [Radiance-dev] Python scripts for Radiance > Date: March 23, 2016 11:28:06 PM PDT > >>> It may or may not be worth to convert >>> them, and in some cases the Python

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Guglielmetti, Robert
There absolutely was an issue here, on Windows, when attempting to apply the workflow documented in the 3-phase tutorial Andy wrote, updated with rfluxmtx. For the life of me I cannot recall the specific error, nor can I find my notes on this. But it was related to reading matrices that were out

Re: [Radiance-dev] Python scripts for Radiance

2016-03-24 Thread Randolph M. Fritz
But one without the usability and portability problems is noticeably more complex. On the other hand, it fixes those problems, and the problem of file names and directories containing spaces as well. If there really was an inherent problem with using pipes on Windows, > then I'm sure I would have

Re: [Radiance-dev] Python scripts for Radiance

2016-03-23 Thread Georg Mischler
It may or may not be worth to convert them, and in some cases the Python version may actually become a literal translation without any added structure. OK, I suppose I would have to see an example of that, preferably something that wasn't organized around a class. One of the things I have alwa

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Randolph M. Fritz
I don't think Perl is necessarily write-only, but it is easy to produce write-only code in it. "Although I don't have a ready solution, it would be good to at least determine the parameters of the problem." Does anyone have an example? When I get a bit more time, I could look into it. -- Rando

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Gregory J. Ward
> From: Georg Mischler > Date: March 22, 2016 12:30:46 PM PDT > ... >> Thinking on it some more, the main issue I have with Python is >> probably the object-oriented structure, which moves it even further >> from a command-line interpreter. For me, the main benefit of using a >> scripting languag

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Randolph M. Fritz
Greg: ​ > > Well, we may need to devise some tests to be sure this is still a > problem, but in the past, Windows would deliver binary files in > 128-byte chunks, meaning that the last chunk might have garbage at the > end of it that was not actually produced by the program that sent it. > Schorsc

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Georg Mischler
Am 2016-03-22 01:34, schrieb Gregory J. Ward: Well, it's still not obvious to me, even after Randoph's explanation (which used different calls). In any case, I was only trying to make the point that Python isn't transparent, either. An unknown language is never immediately transparent without

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Randolph Fritz
I don’t think it’s as awful as that; Python is a widely-known, widely-used, and well-documented language and freely available. I worry more about Perl, because it is so easy to create write-only code in Perl and this becomes a maintenance problem. On the other hand some Unix commands are becom

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Gregory J. Ward
Real quick: > From: "Guglielmetti, Robert" > Date: March 22, 2016 9:37:46 AM PDT > > Eh, I respectfully disagree, here. Languages like Python and Ruby are > making it easy for meatheads like me to write functional cross-platform > programs that can leverage Radiance tools well, and offer users n

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Guglielmetti, Robert
This is getting good... On 3/22/16, 10:02 AM, "Gregory J. Ward" wrote: > >Thinking on it some more, the main issue I have with Python is probably >the object-oriented structure, which moves it even further from a >command-line interpreter. For me, the main benefit of using a scripting >language

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Gregory J. Ward
Removing some stuff to keep things from getting too drawn-out... > From: Georg Mischler > Subject: Re: [Radiance-dev] Python scripts for Radiance > Date: March 22, 2016 4:49:39 AM PDT > > Am 2016-03-22 01:34, schrieb Gregory J. Ward: > ... > Where did you see a double-sub

Re: [Radiance-dev] Python scripts for Radiance

2016-03-22 Thread Georg Mischler
to Unicode, do you? We'd still have to switch between data format (-f*) command options on the two platforms, or suffer significant performance penalties on Unix. Sorry, not sure what you're talking about there. Cheers -schorsch From: Georg Mischler Subject: Re: [Radiance-dev] Pyth

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Randolph M. Fritz
The problem that code solves is finding the name of the invoked command and getting rid of the Windows .exe extension. I'd write it a bit differently: from os.path import basename, splitext ... progname = splitext(basename(sys.argv[0]))[0] (or, at length) progfile = basename(sys.argv[0]

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Gregory J. Ward
TPROGN = os.path.splitext(os.path.split(sys.argv[0])[1])[0] >>> From: Georg Mischler >>> Subject: Re: [Radiance-dev] Python scripts for Radiance >>> Date: March 21, 2016 4:22:47 PM PDT >>> You're arguing with some of the most syntactitcally complex aspect

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Georg Mischler
If that exceeds your syntax input queue, then you're getting old! :P Am 2016-03-22 00:52, schrieb Gregory J. Ward: All I can say is: SHORTPROGN = os.path.splitext(os.path.split(sys.argv[0])[1])[0] From: Georg Mischler Subject: Re: [Radiance-dev] Python scripts for Radiance

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Gregory J. Ward
All I can say is: SHORTPROGN = os.path.splitext(os.path.split(sys.argv[0])[1])[0] > From: Georg Mischler > Subject: Re: [Radiance-dev] Python scripts for Radiance > Date: March 21, 2016 4:22:47 PM PDT > > You're arguing with some of the most syntactitcally complex

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Georg Mischler
t cases for these scripts, but I was never really good about that. I generally wrote something when I needed it or had an example ready, but I didn't have the foresight to keep those examples around, so I'm not much help there. Sorry! -Greg From: Georg Mischler Subject: Re: [Radiance-dev]

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Gregory J. Ward
help there. Sorry! -Greg > From: Georg Mischler > Subject: Re: [Radiance-dev] Python scripts for Radiance > Date: March 21, 2016 2:21:12 PM PDT > > Greg, someone of your capacity will be fluent in the Python syntax within > an hour, the object and exception system in a day, a

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread ascendilex | Wouter Beck
Dear Georg, I would vote for the glaze csh script. Best, Wouter On 03/21/2016 05:02 PM, Georg Mischler wrote: Hi again! I have converted some of the original Radiance shell scripts into Python.

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Georg Mischler
x27;t have much enthusiasm for converting something as complex as genBSDF to Python, where I couldn't understand or fix any problems that arise in future. Cheers, -Greg From: Georg Mischler Subject: [Radiance-dev] Python scripts for Radiance Date: March 21, 2016 9:02:03 AM PDT Hi again! I

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Gregory J. Ward
ture. Cheers, -Greg > From: Georg Mischler > Subject: [Radiance-dev] Python scripts for Radiance > Date: March 21, 2016 9:02:03 AM PDT > > Hi again! > > I have converted some of the original Radiance shell scripts into Python. > https://github.com/gmischler/PyRa

Re: [Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Guglielmetti, Robert
Schorsch, you're making the rest of us look like slackers! I'm all about this move. When I added some new stuff that was written in Ruby, it was less than enthusiastically adopted because of yet another dependency; Perl had recently been added to the dependency list with the new rtcontrib utilitie

[Radiance-dev] Python scripts for Radiance

2016-03-21 Thread Georg Mischler
Hi again! I have converted some of the original Radiance shell scripts into Python. https://github.com/gmischler/PyRad The examples so far are exact drop-in replacements of the original csh or Perl versions, but with some extra functionality and benefits. * usage instructions (-H) * progres