whizard is hosted by Hepforge, IPPP Durham

Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#38 closed enhancement (fixed)

Test/improve/enhance the command language

Reported by: kilian Owned by: kilian
Priority: P3 Milestone:
Component: core Version: 2.0.0alpha
Severity: major Keywords:
Cc:

Description

The command language is still incomplete or the implementation doesn't work (options, blocks etc.) and has to be complete for the beta release. Fine-tuning should be done for the public 2.0 version.

Change History (18)

comment:1 Changed 15 years ago by kilian

Status: newassigned

comment:2 Changed 15 years ago by kilian

Type: defecttask

comment:3 Changed 14 years ago by kilian

Changeset [1289] resolves part of this.

The syntax of variables is now (hopefully) reaching a stable state. For commands that take options, all options that make sense (essentially, those that set variables or other special objects such as cuts) are now allowed and should work.

The remaining tasks include eliminating redundancies (such as the list command, which could be replaced by another version of show), reconsidering the loop command, probably adding a conditional construct, and implementing external I/O (including a log file).

comment:4 Changed 14 years ago by kilian

Loops are done now [1299]. I had to modify some of the code corresponding to variables, and this has broken SLHA reading. To be fixed asap.

comment:5 Changed 14 years ago by kilian

The problems with MSSM handling (not a SLHA problem, but name clash A0=parameter vs. A0=particle) are solved in Changeset [1301]. Variable and loop handling seems to work as it should now.

comment:6 Changed 14 years ago by kilian

Changeset [1302] implements conditionals. The missing pieces are now:

  • Elementary file management (logfile and such)
  • Some user options, e.g., LHAPDF sets
  • clear/delete commands, e.g., for histograms

comment:7 Changed 14 years ago by kilian

'clear' and some other additions are now present. The logfile works, at least for the main program and common cases. (Logging/redirecting output of embedded shell commands is not implemented, however.) I'm not yet satisfied with the file management, but the remaining changes are minimal. So, we're almost feature complete.

comment:8 Changed 14 years ago by Juergen Reuter

Milestone: v2.0-betav2.0-final
Priority: P2P3
Severity: criticalmajor
Summary: Complete the command languageTest/improve/enhance the command language
Type: taskenhancement

WK now added the <expect> syntax in the command language. I proposed a first suggestion for the name of the command language, which has to be discussed. Now we have basically only testing and minor improvements/enhancements. I move the ticket to the next milestone and reduce the priority.

comment:9 Changed 14 years ago by Juergen Reuter

I list a couple of problems here:

01) SINDARIN does not allow a minus sign after an '=': real foo=-2 triggers a fatal. 02) The following completey screws the user

    real foo = 0.01
    real a =   2.0
    int foo = 4
    a = a + foo

as the real foo supersedes the integer, altough being defined later.

03) Error messages are really cryptical.

comment:10 Changed 14 years ago by Juergen Reuter

04) Add the possibility of having complex input parameters for models or at least derived parameters. E.g. WHIZARD could split them automatically into their real and complex parts.

comment:11 Changed 14 years ago by ohl

Milestone: v2.0.0finalgolden-classics

comment:12 Changed 14 years ago by Juergen Reuter

Milestone: golden-classicsv2.0.0final

No, there are some actual important tasks, after they are done by Wolfgang, we can move it.

comment:13 Changed 14 years ago by kilian

Long overdue: cleaned up event-file specifications in r2225.

Example:

simulate (foo, bar) {
  $sample = "foobar"
  sample_format = ascii, hepevt, lhef
}

This will write files "foobar.evt", "foobar.hepevt", "foobar.lhef".

The specification of $sample can be omitted, it defaults to the first process in the list (here: "foo").

The extensions can be redefined, if necessary, as $extension_ascii, $extension_hepmc etc.

Exception: The handling of raw event files (default: on) is controlled by ?write_raw and ?read_raw, as before.

comment:14 Changed 14 years ago by kilian

Change in r2226: The problem 01) above is now solved by assigning '=' and '-' to different character classes. This has some important consequences:

  • The token -> is replaced by =>. This affects process definitions, beam definitions, and parameter scans.
  • The token /= is replaced by <> (as we agreed during the last WHIZARD meeting).
  • The token /~ is replaced by <>~.
  • For clarity, the token == is replaced by ==~.

I have modified the test files (make check) accordingly. However, all input files not in the test suite have to be modified as well. Sorry for that.

comment:15 Changed 14 years ago by kilian

r2246 introduces 'sprintf' and 'printf', essentially interfaces to the corresponding C funtions (stdio.h).

Usage:

$string = "foo"
printf $string

replacing 'echo';

printf "In model %s, the W mass is %g." ($model_name, mW)

showing the syntax for formatting variables. (Currently, only variables, no expressions in the argument!)

Similarly

$string = "bar"
$foobar = sprintf "foo%s" ($string)

yields 'foobar'.

The 'echo' command is redundant now and should be eliminated (just replace by 'printf').

Restrictions:

  • Only strings, integers, and reals are supported (will add complex and aliases later), logicals as strings.
  • The format string is parsed and checked against the arguments (no format string exploits via WHIZARD!)
  • Only standard output channel (with logfile copy) supported so far

comment:16 Changed 14 years ago by kilian

The problem 02) is now solved in r2272. It adds the requirement for declaring all user variables and streamlines their usage. The other important change is reqiring a '=' sign for the loop variable assignment in scans.

comment:17 Changed 14 years ago by Juergen Reuter

Resolution: fixed
Status: assignedclosed

This is basically done, except for the complex variables. WIll see whether we need them or not. Closing this for now.

comment:18 Changed 14 years ago by Juergen Reuter

Milestone: v2.0.0final

Milestone v2.0.0final deleted

Note: See TracTickets for help on using tickets.