Skip to content

Commit

Permalink
Added support for exponential notation in default parameters (#305)
Browse files Browse the repository at this point in the history
* Added support for exponential notation, allowed negative values

* Changed intPattern name to uintPattern. Added comments explaining regexps.

* Added support for exponential notation in default parameters
  • Loading branch information
Vojtone authored and grzanka committed Apr 19, 2019
1 parent 8c453de commit a2b8170
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 36 deletions.
4 changes: 2 additions & 2 deletions docs/jsons.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Single input item that allows insert single number.
"parameterName": "beta",
"label": "Beta",
"placeholder": "0.1",
"defaultValue": 0.1,
"defaultValue": "0.1",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -246,7 +246,7 @@ Single input item that allows insert single number.

* **placeholder** (*string*) - value visible when field is empty

* **defaultValue** (*float/int*) - field initial value
* **defaultValue** (*string*) - field initial value

* **validations** (*array*) - field validation rules

Expand Down
2 changes: 1 addition & 1 deletion src/static/json/DataRange/CSDAEnergyAfterSlabMulti.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"parameterName": "slab_thickness_cm",
"label": "Thickness [cm]",
"placeholder": "Slab thickness [cm]",
"defaultValue": 2.0,
"defaultValue": "2.0",
"description": "Thickness of a slab",
"validations": {
"type": "float",
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/DataRange/CSDAEnergyAfterSlabSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "E_initial_MeV_u",
"label": "Initial Energy [MeV/amu]",
"placeholder": "Initial energy",
"defaultValue": 150,
"defaultValue": "150",
"validations": {
"type": "float",
"min": "0",
Expand All @@ -23,7 +23,7 @@
"parameterName": "slab_thickness_cm",
"label": "Slab thickness [cm]",
"placeholder": "Slab thickness[cm]",
"defaultValue": 3.0,
"defaultValue": "3.0",
"description": "Thickness of slab",
"validations": {
"type": "float",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/DataRange/CSDARangeMulti.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"label": "Final Energy [MeV/amu]",
"placeholder": "Final energy",
"asManyAsPoints": true,
"defaultValue": 0,
"defaultValue": "0",
"validations": {
"type": "float",
"min": "0",
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/DataRange/CSDARangeSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "E_initial_MeV_u",
"label": "Initial Energy [MeV/amu]",
"placeholder": "Initial energy",
"defaultValue": 100,
"defaultValue": "100",
"validations": {
"type": "float",
"min": "1e-7",
Expand All @@ -23,7 +23,7 @@
"parameterName": "E_final_MeV_u",
"label": "Final Energy [MeV/amu]",
"placeholder": "Final energy",
"defaultValue": 0,
"defaultValue": "0",
"validations": {
"type": "float",
"min": "0",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/ElectronRange/MaxElectronRangeMSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "E_MeV_u",
"label": "Ion energy [MeV/amu]",
"placeholder": "10",
"defaultValue": 10.0,
"defaultValue": "10.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/BetaFromESingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "input",
"parameterName": "E_MeV_u",
"label": "Energy \\(\\frac{\\mathrm{MeV}}{\\mathrm{amu}}\\)",
"defaultValue": 10,
"defaultValue": "10",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/DoseFromFluence.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"parameterName": "fluence_cm2",
"label": "Fluence [1/cm2]",
"placeholder": "1e9",
"defaultValue": 1e9,
"defaultValue": "1e9",
"asManyAsPoints": true,
"description": "fluence in 1/cm2",
"validations": {
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/PhysicsRoutines/DoseFromFluenceSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"parameterName": "fluence_cm2",
"label": "Fluence [1/cm2]",
"placeholder": "1e9",
"defaultValue": 1e9,
"defaultValue": "1e9",
"description": "fluence in 1/cm2",
"validations": {
"type": "float",
Expand All @@ -25,7 +25,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV/amu]",
"placeholder": "150",
"defaultValue": 150,
"defaultValue": "150",
"description": "Energy per unit mass",
"validations": {
"type": "float",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/EFromBetaSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "beta",
"label": "Beta",
"placeholder": "0.1",
"defaultValue": 0.1,
"defaultValue": "0.1",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/EFromGammaSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "gamma",
"label": "γ",
"placeholder": "Gamma",
"defaultValue": 2,
"defaultValue": "2",
"validations": {
"type": "float",
"min": "1.00000001",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/EFromMomentumSingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "momentum_MeV_c_u",
"label": "Momentum[MeV/c/amu]",
"placeholder": "momentum per particle",
"defaultValue": 300,
"defaultValue": "300",
"validations": {
"type": "float",
"min": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV/amu]",
"placeholder": "Energy [MeV/amu]",
"defaultValue": 10,
"defaultValue": "10",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/PhysicsRoutines/EnergyLossDistributions.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV]",
"placeholder": "150.0",
"defaultValue": 150.0,
"defaultValue": "150.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -62,7 +62,7 @@
"parameterName": "slab_thickness_mm",
"label": "Slab thickness [mm]",
"placeholder": "1.0",
"defaultValue": 1.0,
"defaultValue": "1.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
2 changes: 1 addition & 1 deletion src/static/json/PhysicsRoutines/GammaFromESingle.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"parameterName": "E_MeV_u",
"label": "Energy",
"placeholder": "10",
"defaultValue": 10,
"defaultValue": "10",
"validations": {
"type": "float",
"min": "0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"parameterName": "E_MeV_u",
"label": "Energy",
"placeholder": "Insert energy",
"defaultValue": 150,
"defaultValue": "150",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down
8 changes: 4 additions & 4 deletions src/static/json/ProtonTherapyModels/BiologicalDoseModels.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"parameterName": "entrance_dose_Gy",
"label": "Entrance dose [Gy]",
"placeholder": "2.0",
"defaultValue": 2.0,
"defaultValue": "2.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -38,7 +38,7 @@
"parameterName": "ref_alpha_beta_ratio",
"label": "reference α/β",
"placeholder": "2.0",
"defaultValue": 2.0,
"defaultValue": "2.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -50,7 +50,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV]",
"placeholder": "150.0",
"defaultValue": 150.0,
"defaultValue": "150.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -62,7 +62,7 @@
"parameterName": "sigma_E_MeV_u",
"label": "Energy spread (σ) [MeV]",
"placeholder": "1.5",
"defaultValue": 1.5,
"defaultValue": "1.5",
"validations": {
"type": "float",
"min": "0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV]",
"placeholder": "150.0",
"defaultValue": 150.0,
"defaultValue": "150.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -38,7 +38,7 @@
"parameterName": "sigma_E_MeV_u",
"label": "Energy spread (σ) [MeV]",
"placeholder": "1.5",
"defaultValue": 1.5,
"defaultValue": "1.5",
"validations": {
"type": "float",
"min": "0.0",
Expand All @@ -50,7 +50,7 @@
"parameterName": "entrance_dose_Gy",
"label": "Entrance dose [Gy]",
"placeholder": "2.0",
"defaultValue": 2,
"defaultValue": "2",
"description": "dose in Gy",
"validations": {
"type": "float",
Expand Down
8 changes: 4 additions & 4 deletions src/static/json/ProtonTherapyModels/ProtonRBEModels.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"parameterName": "entrance_dose_Gy",
"label": "Entrance dose [Gy]",
"placeholder": "2.0",
"defaultValue": 2.0,
"defaultValue": "2.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -38,7 +38,7 @@
"parameterName": "ref_alpha_beta_ratio",
"label": "reference α/β",
"placeholder": "2.0",
"defaultValue": 2.0,
"defaultValue": "2.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -50,7 +50,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV]",
"placeholder": "150.0",
"defaultValue": 150.0,
"defaultValue": "150.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -62,7 +62,7 @@
"parameterName": "sigma_E_MeV_u",
"label": "Energy spread (σ) [MeV]",
"placeholder": "1.5",
"defaultValue": 1.5,
"defaultValue": "1.5",
"validations": {
"type": "float",
"min": "0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/ProtonTherapyModels/WilkensModelDepthLET.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV]",
"placeholder": "150.0",
"defaultValue": 150.0,
"defaultValue": "150.0",
"validations": {
"type": "float",
"min": "0.000001",
Expand All @@ -38,7 +38,7 @@
"parameterName": "sigma_E_MeV_u",
"label": "Energy spread (σ) [MeV]",
"placeholder": "1.5",
"defaultValue": 1.5,
"defaultValue": "1.5",
"validations": {
"type": "float",
"min": "0.0",
Expand Down
4 changes: 2 additions & 2 deletions src/static/json/RDD/RDD.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"parameterName": "E_MeV_u",
"label": "Energy [MeV/amu]",
"placeholder": "150",
"defaultValue": 150,
"defaultValue": "150",
"validations": {
"type": "float",
"min": "0.000001",
Expand Down Expand Up @@ -65,7 +65,7 @@
"parameterName": "rdd_parameter",
"label": "Model params:",
"asManyAsPoints": false,
"defaultValue": 0.00000001,
"defaultValue": "0.00000001",
"description": "Model parameter"
},
{
Expand Down

0 comments on commit a2b8170

Please sign in to comment.