Welcome, Guest
Username: Password: Remember me

TOPIC: code improvement / user contributions

code improvement / user contributions 13 years 6 months ago #1582

  • M8R-bhx08n
  • M8R-bhx08n's Avatar
Hi all,

While trying to install telemac on both Linux and Windows OS, I had a chance to read the perl scripts for launching telemac's programs - files in the bin/ directory.

I think that some of these scripts could be largely improved.
For example:
- reduce code duplication by using perl object oriented aspects.
- reduce scripts size by using pre-existing packages (In particular I think about Cwd, File::Spec, File::Path, and maybe Log4perl too) This may also be useful to reduce the number of errors and improve OS portability
- remove some ugly code like
$systelIni=dirname($0);
$systelIni=dirname($systelIni);
$systelIni="$systelIni$ps"."config$ps"."systel.ini";
and replace it with
$systelIni = catfile(dirname($0),"..","config","systel.ini");
- make code compliant with 'strict' and 'warnings' pragma (just try to run bin/runtel.pl with the -w and -s switches)
- improve crossplateformness (i.e. remove code like that
if($ENV{"OS"} eq "Windows_NT")
  {
#---- Cas du systeme Windows NT
    $ps="\\";
    ($BASE, $TMP) = split(/\n/, `CD`);      # On enleve le NewLine a la fin
 #...
  }
else
  {
#---- Cas du systeme UNIX
    $ps="/";
    ($BASE, $TMP) = split(/\n/, `pwd`);      # On enleve le NewLine a la fin

 # ...
}

I'm willing to do the proposed code changes and to test them under windows and linux. Nevertheless I would know if there is any chance to get the contributions included in a future telemac release. After a quick search, I could not find any license text for the telemac system. So, my two main questions are:
- what do you think about the proposed code changes?
- what is the telemac's team's policy about user code contribution?

Best regards,
Cédric
The administrator has disabled public write access.

Re:code improvement / user contributions 13 years 6 months ago #1583

  • jmhervouet
  • jmhervouet's Avatar
Hello Cédric,

There is a GPL and LGPL licence on Telemac. We prepare a new version of the website for July, where it will be hopefully clearer.

You are welcome to provide better perl code and it will be included in further versions (we have no longer a real perl specialist and do minimum changes if necessary, hence probably the ugly code). Your proposition is indeed what we expect from open source and the users community. However you should know that HR-Wallingford is preparing Python scripts that are due to replace the perl scripts (both will probably be available for some time but the goal is to move to Python).

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re:code improvement / user contributions 13 years 6 months ago #1589

  • M8R-bhx08n
  • M8R-bhx08n's Avatar
Cool, Python is a nice language too.
Regarding the license. I suggest in a first step to include a LICENSE file in the .tar.gz files that are downloadable on the telemacsystem website.

I wish I will be able to send you some code soon. Is there a defined process to submit code?

Best regards
The administrator has disabled public write access.

Re:code improvement / user contributions 13 years 6 months ago #1590

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Well you can send it to me : This email address is being protected from spambots. You need JavaScript enabled to view it., with copy to This email address is being protected from spambots. You need JavaScript enabled to view it. in case I am away.

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.
Moderators: borisb

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.