bout_runners.parameters.bout_paths¶
Contains the class setting the BOUT++ paths.
Classes
|
Class which sets the paths. |
-
class
bout_runners.parameters.bout_paths.
BoutPaths
(project_path: Optional[Union[pathlib.Path, str]] = None, bout_inp_src_dir: Optional[Union[pathlib.Path, str]] = None, bout_inp_dst_dir: Optional[Union[pathlib.Path, str]] = None)[source]¶ Class which sets the paths.
Examples
>>> bout_paths = BoutPaths() >>> bout_paths.project_path Path(/root/BOUT-dev/examples/conduction)
>>> bout_paths.bout_inp_src_dir Path(/root/BOUT-dev/examples/conduction/data)
>>> bout_paths.bout_inp_dst_dir Path(/root/BOUT-dev/examples/conduction/2020-02-12_21-59-00_227295)
>>> bout_paths.bout_inp_dst_dir = 'foo' Path(/root/BOUT-dev/examples/conduction/foo)
- Attributes
- __project_pathNone or Path
Getter and setter variable for project_path
- __bout_inp_src_dirNone or Path
Getter and setter variable for bout_inp_src_dir
- __bout_inp_dst_dirNone or Path
Getter and setter variable for bout_inp_dst_dir
project_path
PathSet the properties of self.project_path.
bout_inp_src_dir
PathSet the properties of bout_inp_src_dir.
bout_inp_dst_dir
PathSet the properties of bout_inp_dst_dir.
Methods
_copy_files()
Copy BOUT.inp from bout_inp_src_dir to bout_inp_dst_dir
Set the paths.
- Parameters
- project_pathNone or Path or str
Root path of make file If None, the path of the path of the root caller will be used
- bout_inp_src_dirNone or str or Path
The path to the BOUT.inp source directory (relative to self.project_path) If None, data will be used
- bout_inp_dst_dirNone or str or Path
The path to the BOUT.inp bout_inp_dst_dir directory (relative to self.project_path) If None, the current time will be used
- Attributes
bout_inp_dst_dir
Set the properties of bout_inp_dst_dir.
bout_inp_src_dir
Set the properties of bout_inp_src_dir.
project_path
Set the properties of self.project_path.
-
property
bout_inp_dst_dir
¶ Set the properties of bout_inp_dst_dir.
The setter will convert bout_inp_dst_dir an absolute path (as the input is relative to the project path), and copy BOUT.inp from self.bout_inp_src_dir to self.bout_inp_dst_dir
The input should be the path to the BOUT.inp bout_inp_dst_dir directory (relative to self.project_path) If None, the current time will be used
- Returns
- Path
Path to the destination directory
-
property
bout_inp_src_dir
¶ Set the properties of bout_inp_src_dir.
The setter will convert bout_inp_src_dir an absolute path (as the input is relative to the project path), check that the directory exists, and copy the BOUT.inp file to the bout_inp_dst_dir path (self.bout_inp_dst_dir)
The input should be the path to the BOUT.inp source directory (relative to self.project_path) If None, “data” will be used
- Returns
- self.__bout_inp_src_dirPath
The absolute path to the BOUT.inp source directory
- Raises
- FileNotFoundError
If no BOUT.inp file is found in the directory
-
property
project_path
¶ Set the properties of self.project_path.
If None is specified, the path of the path of the root caller will be used
- Returns
- Path
Absolute path to the root of make file