From 679578a457da0d6e7dff713e8abb0cbc4fb53288 Mon Sep 17 00:00:00 2001 From: "pascale.noyret" Date: Tue, 31 Mar 2020 13:59:15 +0200 Subject: [PATCH] legere amelioration de l anglais --- Editeur/__init__.py | 2 - Ihm/I_FICHIER.py | 1 - docCataWriter/cata_terms.rst | 21 ++++++++ docCataWriter/first_notions.rst | 82 +++++++------------------------ docCataWriter/python_rules.rst | 13 +++-- docCataWriter/simp.rst | 34 ++++++------- docCataWriter/structure_rules.rst | 55 ++++++++++----------- 7 files changed, 88 insertions(+), 120 deletions(-) create mode 100644 docCataWriter/cata_terms.rst diff --git a/Editeur/__init__.py b/Editeur/__init__.py index b32d290b..266bf453 100644 --- a/Editeur/__init__.py +++ b/Editeur/__init__.py @@ -18,6 +18,4 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # """ - Ce package contient les fonctionnalites COMMUNES necessaires - aux deux editeurs graphiques QT et TK """ diff --git a/Ihm/I_FICHIER.py b/Ihm/I_FICHIER.py index 31b12cae..94478178 100644 --- a/Ihm/I_FICHIER.py +++ b/Ihm/I_FICHIER.py @@ -29,7 +29,6 @@ class Fichier: def __convert__(self,valeur): # Attention ne verifie pas grand chose - # cela vaut-il la peine de refaire ce que Qt fait tres bien if type(valeur) != bytes and type(valeur) != str: return None return valeur diff --git a/docCataWriter/cata_terms.rst b/docCataWriter/cata_terms.rst new file mode 100644 index 00000000..83ffc4ec --- /dev/null +++ b/docCataWriter/cata_terms.rst @@ -0,0 +1,21 @@ +EFICAS terms +============ + +Apart of a root node (named JDC_CATA), catalogs contain different types of entities : + + - terminal_symbol : SIMP (SIMPle type) or SIMP_keyword + - group_of_eficas_keyword : FACT (shorcut for FACTOR) or BLOC (conditionnal FACT): + - Content elements are terminal_symbol or group_of_eficas_keyword + - The grouping of these keywords is important from a data modelling perpective. + - The group_of_eficas_keyword can be conditional and only becomes necessary if another parameter meets a condition (ie wind_direction is only necssary if wind_speed is not nul) + - eficas_keyword : terminal_symbol or group_of_eficas_keyword + - commands : PROC (shortcut for procedure) or OPER (shortcut for operator). + - they constitute the second level of the hierachical tree (after root node). + - PROC and OPER both contain other keywords (group or terminal_symbol). + - an OPER returns a user class, unlike PROC which returns nothing. + - this objet has a type and a name. + - rules : defines the structure of the dataset (if element A is present, element B has to be present also) or order of the commands (ie : element START is defined before END) + + - concept : is a user defined class declaration. It can be used as a type for a parameter. Nothing is pre-judged about this class implementation. The actual definition/implementation can be found in the context of code project. + +Catalogs have a python syntax :ref:`python-label` diff --git a/docCataWriter/first_notions.rst b/docCataWriter/first_notions.rst index 066fa9a9..6f86ce4b 100644 --- a/docCataWriter/first_notions.rst +++ b/docCataWriter/first_notions.rst @@ -5,76 +5,30 @@ Catalog ------- Catalogs are a simple way to express a data model. -It organizes the elements and specifies relationships between them. -This could be seen as a hierarchical model ordered in a tree. +They organize the elements and specifie relationships between them. -Once the catalog is well-defined, EFICAS generates automatically an XSD file which may be customized. -These are two views of the same data model. This business model is a "kind" of user data template file. -The user data set python and/or xml file(s) is/are validated in respect to the catalog and/or XSD file. -One may write these files by hands or using EFICAS-toolkit or EFICAS-gui to generate it. +A Catalog defines the rules of parameters validity but also, and mainly, the rules of coherency of a dataset, of its structure. +for example, this means : -The generated python/xml parameter files can be seen in two ways : - - 1. This can be seen as an organized way of calling data object contructors with their parameters - * Constructing a new user data set that conforms to a dataflow model consists in selecting the desired data objects from the available data organized by the model. - - 2. This can be seen as an a set of computational steps (commands) with their arguments - * Constructing a new user commands set that conforms to a workflow model consists in selecting the desired commands from the available commands organized by the model. - -| Each selected data/command has its specific parameters that the user must define. Some are required, others require multiple occurrences, others require the user to name the returned concept. -| A "concept" is a user defined class declaration used to refer it in the catalog. Nothing is prejudged about its implementation. -| The actual definition/implementation can be found in the context of your code project. - - -| The data/commands available as hierarchical graph roots are called steps. -| A VIMMP user data/commands set is a collection of 'step'. -| Each step is a coherent process/part of the complete workflow/dataflow. This allows to understand the whole scheme of the workflow/dataflow. + - the type and cardinality of element + - how to order the elements in relations to each other, + - the simultaneous (or exclusive) existence of certain parameters/groups of parameters. +This rules ensure that a dataset constitutes a coherent entity. -Simulation example ------------------- +Once the catalog is well-defined, EFICAS generates automatically an XSD file. +These are two views of the same data model. -For example, VIMMP platform will typically address/execute the following steps for : +The user dataset python and/or xml file(s) is/are validated and conform(s) to the catalog and/or XSD file. +The generated python/xml parameter files can be seen : -CFD-type simulations : -~~~~~~~~~~~~~~~~~~~~~~ + 1. as hierarchical data ordered in a tree. - * Upload the mesh of the domain (note that the geometry of the domain is contained in the mesh); - * Define the physical properties of the fluid(s) involved (e.g., density, viscosity, thermal diffusivity, etc.); - * Define the boundary conditions to be applied (e.g., inlet/outlet/symmetry/wall boundaries); - * Define the simulation parameters (e.g., time step, number of iterations of the simulated time lapse); - * Define the fields to be stored as outputs (note that “classical CFD methods” usually handles fields and, therefore, mesh- and vector-based fields) - -DPD-type simulations : -~~~~~~~~~~~~~~~~~~~~~~ - - * Upload the geometry of the domain in which the simulation is to be performed; - * Define the physical variables attached to each particle (note that classical DPD formulations, as most particle-based mesoscopic methods, relies on the kinetic approach in which only particle positions and velocities are retained (meaning that 6 variables are attached to each particle). However, this is not necessarily always the case for recent DPD formulations for multi-component systems, such as fluid-colloids systems, and for other particle-based methods used, for instance, in hybrid particle/fluid models. (cf \*) - * Define the boundary conditions to be applied (typically, periodic conditions or more involved ones when needed) - * Define the physical parameters for the particle system (i.e., masses, electric charges, etc.) - * Define the parameters entering the selected expressions of inter-particle forces (e.g., expression and parameters entering the soft potential used for the conservative force between DPD particles, weight function and friction coefficient for the dissipative force, temperature (thermostat) used explicitly in the random or Brownian force, cut-off length for potentials, target values such as temperature and pressure, etc.); - * Define the simulation parameters (e.g., time step and number of particles to be simulated in the domain. Note that each particle is a “computational element” similar to a cell in a mesh); - * Define the statistics to be extracted from the particle set (e.g., diffusivity, surface tension, etc.), which are the outputs to be mapped to another code in a linked workflow. - -*\*Addendum : In some cases, particle forces are not to be regarded as physical variables since no evolution equation is written for them and since they are derived from the knowledge of particle velocities and positions through the chosen Material Relations.* - -These several points will be steps for VIMMP data/commands models. - -Catalog vocabulary ------------------- + 2. as an organized way of calling data object contructors with their parameters. + + 3. as a set of computational steps (commands) with their arguments (very close to python code) -Apart of the root node JDC_CATA, catalogs contains three natures of entities : - - - terminal_symbol : SIMP (SIMPle type) or SIMP_keyword - - group_of_eficas_keyword : FACT (shorcut for FACTOR) or BLOC (conditionnal FACT): - - content elements are terminal_symbol or group_of_eficas_keyword - - grouping these keywords has significance from the point of view of business data modeling. - - group_of_eficas_keyword can be conditional and becomes necessary only if another parameter respects a condition (ie wind_direction is needed only if wind_speed is not nul) - - eficas_keyword : terminal_symbol or group_of_eficas_keyword - - commands : PROC (shortcut for procedure) or OPER (shortcut for operator). - - they constitute the second level of the hierachical tree (after root node). - - both PROC and OPER contain other keywords (group or terminal_symbol). - - an OPER returns a user class, unlike PROC which returns nothing. - -Catalogs have a python syntax :ref:`python-label` +| The data/commands roots are called steps. +| A VIMMP user data/commands set is a collection of 'step'. +| Each step is a consistent process/part of the complete workflow/dataflow. This make it possible to understand the whole scheme of the workflow/dataflow. diff --git a/docCataWriter/python_rules.rst b/docCataWriter/python_rules.rst index fdc665ca..ec0f277f 100644 --- a/docCataWriter/python_rules.rst +++ b/docCataWriter/python_rules.rst @@ -7,7 +7,7 @@ Rules for python syntax Variable names and identifiers are similar to those in many other languages : ----------------------------------------------------------------------------- -* They start with a letter (A_Z or a-z) or underscore "_"". +* They start with a letter (A_Z or a-z) or an underscore "_"". * They are followed by letters, numbers or underscores. * They are case-sensitive. * A string is a sequence of caracters enclosed by a matching pair of single or double quotes. @@ -30,15 +30,15 @@ Python's way for assigning values to variables: * Keep in mind that in python files, the simplest form of assignement is : variable = value * The hash character (#) starts a comment -* Tuples are enclosed in parentheses. -* Lists are enclosed in bracked. -* In tuples or lists, a ',' follows each item especially the last one. +* Tuples are enclosed in brackets. +* Lists are enclosed in brackets. +* In tuples or lists, a ',' follows each item, especially the last one. Catalogs are executable python files: ------------------------------------- -* bracked have to be closed. -* if needed, classes or functions should be defined. +* brackets have to be closed. +* if needed, classes or functions must be defined. * arguments are separated with ',' :: @@ -50,4 +50,3 @@ This is a instantiation operation. it creates an object of type SIMP. the SIMP You have to respect python syntax. - diff --git a/docCataWriter/simp.rst b/docCataWriter/simp.rst index 56319e52..4cd5421b 100644 --- a/docCataWriter/simp.rst +++ b/docCataWriter/simp.rst @@ -4,8 +4,8 @@ Defining a Keyword Definition and Usage ____________________ -A model keyword specifies an input parameter. It specifies the information (ie name, type) and some of the constraints on the value of the parameter. -A model keyword has a parent : It is located in a command (in a PROC or OPER at the second level of the tree) or inside a group (BLOC or FACT). +A model keyword specifies an input parameter. It specifies the information (ie name, type) and some of the constraints on the parameter value. +A model keyword has a parent : It is located in a command (in a PROC or OPER at the second level of the tree) or within a group (BLOC or FACT). Syntax ______ @@ -19,15 +19,15 @@ Source line code is : myKeyword = SIMP (typ = 'F') -| Attribute "typ" defines the keyword type (in this case, float) -| "myKeyword" is the keyword name. it is a python label. A keyword can not have the same name as its brothers. -| Attribute *typ* is mandatory. Other SIMP attributes (see below) have default value and are optional. +| the "typ" attribure defines the type of keyword (in this case, float) +| "myKeyword" is the name of the keyword. it is a python label. A keyword can not have the same name as its brothers. +| the *typ* attribute is mandatory. The other SIMP attributes (see below) have a default value and are optional. Typ ~~~ -The attribute *typ* can take several values : +The *typ* attribute can take several values : - A simple type : * boolean (bool) @@ -69,7 +69,7 @@ The attribute *typ* can take several values : def info(self): return "Tuple of %s elements" % self.ntuple - * Then, inside each tuple, each model element has a specified type. + * Then, within each tuple, each model element has a specified type. :: @@ -78,13 +78,13 @@ The attribute *typ* can take several values : length = SIMP(statut ='o', typ=Tuple(2), validators=VerifTypeTuple(('R' ,'TXM' )),), - means that pair_identification is a tuple of two strings, simulation_box_sizes a tuple of three floats and lenght a tuple which first parameter is a float and second a string. + means that pair_identification is a tuple of two strings, simulation_box_sizes a tuple of three floats and lenght a tuple whose first parameter is a float and second one a string. * Valid values for pair_identification : ('A', 'A'), ('A','B') * Valid values for simulation_box_sizes : (1,1.,0), (2.,-2.5, 10+3) - * Valid values for length : (1,'m'), (2., 'cm') but also (-500, 'Fahr') or (32, 'fareneit') + * Valid values for length : (1,'m'), (2., 'cm') but also (and badly) (-500, 'Fahr') or (32, 'fareneit') - .. note:: A tuple element is not seen as a list but as ONE element. (it is possible to define list of tuple) + .. note:: A tuple element is not seen as a list but as ONE element. (it is possible to define list of tuple -see the paragraph 'cardinality' ) - A directory or a file (existing or not) @@ -98,7 +98,7 @@ The attribute *typ* can take several values : +-------------------------------------+-----------------------------------------------------+ |an existing file with specific suffix| typ=('Fichier','JDC Files (*.comm);;All Files (*)') | +-------------------------------------+-----------------------------------------------------+ - |a non-allready existing file | typ=('Fichier',"",'Sauvegarde'), | + |a non-existing file | typ=('Fichier',"",'Sauvegarde'), | +-------------------------------------+-----------------------------------------------------+ |a file (existing or not) | typ='FichierNoAbs' | +-------------------------------------+-----------------------------------------------------+ @@ -108,8 +108,8 @@ The attribute *typ* can take several values : .. note:: To filter filenames, you have to set the *typ* attribute with a python tuple : * The first element is a fixed string value : *'Fichier'* , *'Repertoire'* , *'FichierNoAbs'* , *'FichierOuRepertoire'* - * The second element is a Qt filter string as defined by QT. This string is used only by the graphical interface. The filter is inactive for *typ* *'Repertoire'* . - * The third element is only used with the value *'Sauvegarde'* in the triple *('Fichier',"",'Sauvegarde')* to activate the non-alreay existing file usecase + * The second element is a Qt filter string as defined by QT. This string is only used by the graphical interface. The filter is inactive for *typ* *'Repertoire'* . + * The third element is only used with the value *'Sauvegarde'* in the triple *('Fichier',"",'Sauvegarde')* to activate the non-existing file usecase. - Or previously user defined type in the catalog (a mesh for example) @@ -119,15 +119,15 @@ The attribute *typ* can take several values : class mesh (ASSD) : pass myMesh=SIMP(typ = 'mesh') - - In this case, myMesh is a keyword waiting a mesh instance. this instance has to be created with an OPER command. + + In this case, myMesh is a keyword waiting for a mesh instance. This instance has to be created with an OPER command. (todo label) Cardinality ~~~~~~~~~~~ -It is possible to constrain the number of instances (cardinality) of a keyword. The cardinality is specified using the min and max attributes. -If min=max=1 (default), the keyword has a single value. if max > 1, parameter is a list. min/max specify the minimum/maximum number of occurences in the list. 'max= "**"' sets no upper limit for the maximal cardinality. +It is possible to constrain the number of occurences (cardinality) of a keyword. The cardinality is specified using the min and max attributes. +If min=max=1 (default), the keyword has only one single value. if max > 1, parameter is a list. min/max specify the minimum/maximum number of occurences in the list. 'max= "**"' does not set an upper limit for the maximum cardinality, but allows you to enter as many values as necessary. .. code-block:: python diff --git a/docCataWriter/structure_rules.rst b/docCataWriter/structure_rules.rst index 404a9df0..2938374d 100644 --- a/docCataWriter/structure_rules.rst +++ b/docCataWriter/structure_rules.rst @@ -24,7 +24,7 @@ Syntax is : AU_MOINS_UN ----------- -AU_MOINS_UN rule forces to create at least one eficas_keyword in the list. More than one can be created. +AU_MOINS_UN rule requires to create at least one eficas_keyword from the list. More than one can be created. :: Structure = FACT ( statut ='f', @@ -35,13 +35,13 @@ AU_MOINS_UN rule forces to create at least one eficas_keyword in the list. More ); If Structure is defined, one of the keyword 'Beam', 'Bar', 'Grid' is also defined. - * If none of these keywords is present, Structure is unvalid. - * If only Beam is present, Structure is valid. - * If both Beam and Bar are present, Structure is valid. + * If none of these keywords are present, the structure is unvalid. + * If only the word "Beam" is present, the structure is valid. + * If both keywords "Beam" and "Bar" are present, the structure is valid. UN_PARMI -------- -UN_PARMI rule obliges the user to create one and only one eficas_keyword of the list. +UN_PARMI rule obliges the user to create one and only one eficas_keyword from the list. :: FOR_DPD = BLOC(condition = "code=='DPD'", @@ -51,15 +51,15 @@ UN_PARMI rule obliges the user to create one and only one eficas_keyword of the The user must select Initialisation or (exclusive or) Solver_Input. - * If the user doesn't select any of these keywords, the dataset is unvalid. + * If the user does not select any of these keywords, the dataset is invalid. * If he selects only Solver_Input, the dataset is valid. * If he selects only Initialisation, the dataset is valid. - * If he selects both, the dataset is unvalid. (Ihm will not proposed the keyword Initialisation if Solver_Input already exists.) + * If he selects both, the dataset is invalid. (Ihm will not proposed the keyword Initialisation if Solver_Input already exists.) EXCLUS ------ -EXCLUS means that, if one of the eficas_keyword is created, the others won't be allowed. +EXCLUS means that, if one of the eficas_keyword is created, the others will not be allowed. :: JOB_DURATION = FACT(statut='o', @@ -68,17 +68,16 @@ EXCLUS means that, if one of the eficas_keyword is created, the others won't be ...), -Only one of the keyword or none is allowed. - * If the user doesn't select any of these keywords, JOB_DURATION is valid. - * If he selects only duration, JOB_DURATION is valid. - * If he selects only number_of_time_step, JOB_DURATION is valid. - * If he selects only end_at, JOB_DURATION is valid. - * Otherwise, JOB_DURATION is unvalid +Only one or none of the keyword are allowed. + * If the user does not select any of these keywords, JOB_DURATION is valid. + * If he only selects duration, JOB_DURATION is valid. + * If he only selects number_of_time_step, JOB_DURATION is valid. + * If he only selects end_at, JOB_DURATION is valid. + * Otherwise, JOB_DURATION is invalid ENSEMBLE -------- -The rule means that if one eficas_keyword is selected, the others have to be also. -The keywords order is not meaningful. +The rule means that if one eficas_keyword is selected, the others must be selected as well. :: GRILLE = FACT(statut='f', @@ -87,15 +86,14 @@ The keywords order is not meaningful. ...), if GRILLE is used in the dataset - * If the user doesn't select any of these keywords, GRILLE is valid. + * If the user does not select any of these keywords, GRILLE is valid. * If he selects only ORIG_AXE, GRILLE is invalid. * If he selects both ORIG_AXE and AXE, GRILLE is valid. PRESENT_PRESENT --------------- -The rule means that if the FIRST eficas_keyword is selected, the others have to be also. -The keywords order is meaningful. +The rule means that if the FIRST eficas_keyword is selected, the others must be selected as well. :: FREQUENCE = FACT(statut='f', @@ -105,16 +103,15 @@ The keywords order is meaningful. That means : - * If the user doesn't select any of these keywords, FREQUENCE is valid. + * If the user does not select any of these keywords, FREQUENCE is valid. * If he selects only FREQ_MAX, FREQUENCE is valid. - * If he selects only FREQ_MIN, GRILLE is unvalid. - * If he selects both FREQ_MIN, FREQ_MAX and FREQ_PAS, GRILLE is valid. + * If he selects only FREQ_MIN, GRILLE is invalid. + * If he selects both FREQ_MIN, FREQ_MAX and FREQ_PAS, GRILLE is valid. PRESENT_ABSENT -------------- -The rule means that if the FIRST eficas_keyword is selected, the others aren't allowed. -The keywords order is meaningful. +The rule means that if the FIRST eficas_keyword is selected, the others are not allowed. :: GRID = FACT(statut='f', @@ -122,14 +119,14 @@ The keywords order is meaningful. ), ...), -That means : +This means : - * If the user doesn't select any of these keywords, GRID is valid. + * If the user does not select any of these keywords, GRID is valid. * If he selects only GroupOfNodes, GRID is valid. - * If he selects both GroupOfFaces and GroupOfNodes, GRID is unvalid. + * If he selects both GroupOfFaces and GroupOfNodes, GRID is invalid. -All rules can be combinated, creating more complicated rules. +All rules can be combinated, which creates more complicated rules. :: @@ -145,4 +142,4 @@ That means : * If the user select 'GroupOfNodes', GRID is valid. * If the user select 'GroupOfFaces' and 'GroupOfEdges', GRID is valid. * If he selects none of these keywords GRID is valid. - * Otherwise Grid is unvalid + * Otherwise Grid is invalid -- 2.39.2