Note
Go to the end to download the full example code
DesignSpace import and export from disk¶
In this example, we will see how to read, filter, and export a design space from the disk.
from __future__ import annotations
from gemseo import configure_logger
from gemseo import read_design_space
from gemseo import write_design_space
configure_logger()
<RootLogger root (INFO)>
Read a design space from a file¶
The user can read a design space from a file using the
create_design_space()
function.
design_space = read_design_space("design_space.csv")
design_space
Filtering the design space¶
The user can filter the design space in order to only keep some variables. To
do so, the user can use the DesignSpace.filter()
method:
design_space.filter(["x1", "x2"])
design_space
Export the design space¶
The user can export a DesignSpace
instance by using the
write_design_space()
function.
write_design_space(design_space, "new_design_space.csv")
Total running time of the script: (0 minutes 0.007 seconds)