diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..020b7cfa --- /dev/null +++ b/404.html @@ -0,0 +1,194 @@ + + + + + + + + Koswat + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • +
  • +
+
+
+
+
+ + +

404

+ +

Page not found

+ + +
+
+ +
+
+ +
+ +
+ +
+ + + + + +
+ + + + + + + + diff --git a/assets/_mkdocstrings.css b/assets/_mkdocstrings.css new file mode 100644 index 00000000..98e1c72a --- /dev/null +++ b/assets/_mkdocstrings.css @@ -0,0 +1,28 @@ + +/* Avoid breaking parameters name, etc. in table cells. */ +.doc-contents td code { + word-break: normal !important; +} + +/* For pieces of Markdown rendered in table cells. */ +.doc-contents td p { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +/* Avoid breaking code headings. */ +.doc-heading code { + white-space: normal; +} + +/* Improve rendering of parameters, returns and exceptions. */ +.doc-contents .field-name { + min-width: 100px; +} +.doc-contents .field-name, .field-body { + border: none !important; + padding: 0 !important; +} +.doc-contents .field-list { + margin: 0 !important; +} diff --git a/changelog.html b/changelog.html new file mode 100644 index 00000000..9c3fb8aa --- /dev/null +++ b/changelog.html @@ -0,0 +1,515 @@ + + + + + + + + Changelog - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Release-2023 (2023-11-07)

+

Feat

+
    +
  • Added order_strategy submodule for determining reinforcement features across a dike traject based on default order
  • +
  • Added new class to better handle / generate the location-reinforcement matrix
  • +
+

Fix

+
    +
  • improve rounding
  • +
  • improve rounding
  • +
  • improve rounding
  • +
  • show cost per km if no locations present
  • +
  • add @property to total_cost
  • +
  • add @property to total_cost
  • +
  • add @property to total_cost
  • +
  • test on presence of construction costs
  • +
  • correct return type
  • +
  • Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString
  • +
  • corrected berm width calculations (#114)
  • +
  • corrected berm width calculations
  • +
  • merge leftovers
  • +
  • rename "raise" to "surtax" throughout KOSWAT
  • +
  • rename "raise" to "surtax" throughout KOSWAT
  • +
  • correct symbol name
  • +
  • correct symbol name
  • +
  • typo comment
  • +
  • typo comment
  • +
  • Added logic to avoid creating added / removed layers geometries when there were no modifications
  • +
  • Added default values as math.nan for koswatscenario
  • +
  • We now replace not-provided values from a KoswatScenario when calculating new reinforcements
  • +
  • docu corrections
  • +
  • docu corrections
  • +
  • docu corrections
  • +
+

v0.14.1 (2023-11-08)

+

v0.14.0 (2023-11-07)

+

Feat

+
    +
  • Added order_strategy submodule for determining reinforcement features across a dike traject based on default order
  • +
  • Added new class to better handle / generate the location-reinforcement matrix
  • +
+

Fix

+
    +
  • improve rounding
  • +
  • improve rounding
  • +
  • improve rounding
  • +
  • show cost per km if no locations present
  • +
  • add @property to total_cost
  • +
  • add @property to total_cost
  • +
  • add @property to total_cost
  • +
  • test on presence of construction costs
  • +
  • correct return type
  • +
  • Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString
  • +
  • corrected berm width calculations (#114)
  • +
  • corrected berm width calculations
  • +
  • merge leftovers
  • +
  • rename "raise" to "surtax" throughout KOSWAT
  • +
  • rename "raise" to "surtax" throughout KOSWAT
  • +
  • correct symbol name
  • +
  • correct symbol name
  • +
  • typo comment
  • +
  • typo comment
  • +
  • Added logic to avoid creating added / removed layers geometries when there were no modifications
  • +
  • Added default values as math.nan for koswatscenario
  • +
  • We now replace not-provided values from a KoswatScenario when calculating new reinforcements
  • +
  • docu corrections
  • +
  • docu corrections
  • +
  • docu corrections
  • +
+

v0.13.0 (2023-01-31)

+

Feat

+
    +
  • volume_cost_parameters_builder.py: We now calculate the costs based on the ini input file
  • +
+

v0.12.1 (2023-01-27)

+

Fix

+
    +
  • calc_library.py: Standrad reinforcement calculation now uses a different method to make sure the added geometry is normalized
  • +
+

v0.12.0 (2023-01-26)

+

Feat

+
    +
  • koswat/cost_report: Koswat Summary now includes all available locations even if they are not suitable for any reinforcement profile. Adapted the rest of the classes to generate a proper matrix also during export
  • +
+

v0.11.7 (2023-01-25)

+

Fix

+
    +
  • calc_library.py: We now check whether the last point intersects with the line drawn between the first two points to avoid precission issues
  • +
+

v0.11.6 (2023-01-25)

+

Fix

+
    +
  • calc_library.py;koswat_coating_layer_builder.py: We now round up the coordinates of the calculated layers to avoid precision issues
  • +
  • calc_library.py: Corrected collection of surface points, added extra plot for reinforced profiles
  • +
+

v0.11.5 (2023-01-12)

+

Fix

+
    +
  • calc_library: Small correction to avoid crashing when trying to order multiline strings
  • +
+

v0.11.4 (2023-01-12)

+

Fix

+
    +
  • standard_reinforcement_layers_wrapper_builder: Fixed sand layer added surface not being correct
  • +
  • calc_library.py: After doing a geometry union the resulting geometry gets now their points in order
  • +
+

v0.11.3 (2023-01-12)

+

Fix

+
    +
  • koswat/configuration: Fixed creation of scenarios based on selected dike sections
  • +
+

v0.11.2 (2022-12-21)

+

v0.11.1 (2022-12-20)

+

Fix

+
    +
  • koswat/main.py: Renamed main file to fit to python main expected module
  • +
+

v0.11.0 (2022-12-20)

+

Feat

+
    +
  • koswat/koswat_handler.py: We now accept a log_output argument to specify the directory where to save the koswat run log.
  • +
+

v0.10.0 (2022-12-20)

+

Feat

+
    +
  • koswat/configuration/converters: Created converters fom to dom
  • +
  • koswat/configuration/io/converters/: Added configuration converters for the analysis section. We can now generate input profiles from the ini files
  • +
  • koswat/configuration/io/csv: Added import of KoswatInputProfiles
  • +
  • KoswatHandler;KoswatLogger: Added handler and logger for koswat runs from CLI
  • +
+

Fix

+
    +
  • koswat/geometries/calc_library.py: We now order the points of the geometries so that calculations can be done correctly
  • +
  • koswat/calculations: Corrected profile calculation for all types and their tests. These changes come directly from Peter de Grave
  • +
  • koswat/configuration/io/koswat_run_settings_importer.py: corrected filtering of selected input profiles
  • +
  • koswat_dike_locations_shp_reader.py: Fixed enumerating a filtered list instead of filtering after enumerating
  • +
  • KoswatSurroundingsConverter: Fixed return as it was only giving the latest mapped FOM
  • +
  • configuration/io/converters: Fixed return of data and adapted tests
  • +
  • koswat_analysis_converter.py: Small fix to converter
  • +
  • koswat_General_settings.py: Fix validation for surroundings
  • +
  • koswat/calculations: Fixed calculations due to new profile input property
  • +
  • KoswatMaterialType: Minor fix regarding usage of new KoswatMaterialType
  • +
  • KoswatMaterialType: Adapted code to use the enum instead of strings
  • +
+

Refactor

+
    +
  • koswat/configuration/io: Moved converters into io
  • +
  • koswat/dike/surroundings/io/shp: Moved shp reader and fom to surroundings module
  • +
  • koswat/configuration: Integrating mapping of files to fom's during settings import
  • +
  • koswat/dike/surroundings/io: Moved previous CSV reader into a concrete module within dike/surroundings. Created protocols for csv reading so it can be repurposed
  • +
  • KoswatMaterialType: Made koswat material into an enum. Adapted code overall in the source
  • +
+

v0.9.0 (2022-12-12)

+

Feat

+
    +
  • KoswatGeneralSettings: Created DOM for koswat general settings configuration
  • +
  • KoswatConfigurationIniImporter: We can now map all different ini fom classes to the config class
  • +
  • koswat/configuration: Created koswat configuration module and related class KoswatConfiguration to encapsulate all require information for a koswat analysis
  • +
  • KoswatScenarioIniFom: It is now possible to read a KoswatScenarioIniFom from file
  • +
  • KoswatDikeSelectionIniFom: It is now possible to read a Dike Selection INI file into its corresponding FOM
  • +
  • KoswatCostsIniFom: Added logic to fully implement reading of a KoswatCostsIniFom file
  • +
  • KoswatCostsIniFom: Added koswat costs ini file
  • +
  • KoswatIniReader: Created koswat ini reader and initial approach to reading the general Koswat INI file
  • +
+

Fix

+
    +
  • KoswatCosts: Added class conversion to dictionary
  • +
+

Refactor

+
    +
  • koswat/configuration/models: Moved configuration data object models into their own module. Fixed / grouped imports
  • +
  • KoswatDikeSelection: Koswat dike selection now implements a new type KoswatDikeSelectionTxtFom with related reader
  • +
  • koswat_scenario: Moved koswat scenario into koswat/configuration
  • +
  • koswat/io: Adapted export / import fom protocol
  • +
+

v0.8.2 (2022-12-09)

+

Fix

+
    +
  • KoswatLayerProtocol: we now have two different geometries for a layer, so that the profile with the layer and the stand alone representation of it are better reached
  • +
+

v0.8.1 (2022-11-21)

+

Fix

+
    +
  • SummaryMatrixCsvExporter: We now provide NANs when volume parameter is not defined
  • +
  • summary_matrix_csv_exporter: We now correctly export all required information to the csv for the user
  • +
+

v0.8.0 (2022-11-19)

+

Feat

+
    +
  • KoswatPlotContext: Created plot context handler so it's easier to initialize and close plots
  • +
+

v0.7.0 (2022-11-18)

+

Feat

+
    +
  • koswat/cost_report/io/plots/: Added module for cost_report export plots logic
  • +
  • koswat_profile_plot.py: We can now set a unique color for layers_wrapper and profile plots
  • +
  • koswat/plots/dike/: Extracted dike plotting logic into separate classes
  • +
  • koswat/plots/geometries: Created module with plotting for regular geometries from shapely
  • +
+

Fix

+
    +
  • koswat/plots/utils.py: Replaced wrapper as it is not a good approach
  • +
  • characteristic_points_builder.py: Resolved a circular dependency
  • +
+

Refactor

+
    +
  • koswat/calculations/io/: Extracted plot exporters from calculations into their corresponding directory
  • +
  • koswat/plots: Create concrete module for plotting
  • +
  • koswat/io: Moved io files into their corresponding modules
  • +
+

v0.6.0 (2022-11-11)

+

Feat

+
    +
  • VolumeCalculationParameters: Included all operations required to for volume calculation
  • +
  • ReinforcementProfileProtocol: Added new property to retrieve the new ground level surface
  • +
  • OutsideSlopeReinforcementLayersWrapperBuilder: Added builder for for the outside slope reinforcement layers wrapper
  • +
  • StandardReinforcemetnLayersWrapperBuilder: Added logic to generate the geometries of a standard reinforcement dike
  • +
  • ReinforcementLayersWrapper: We now have dedicated builders for the LayersWrapper associated with a Reinforcement
  • +
  • ReinforcementProfileBuilderProtocol: Created protocol for better hierarchy
  • +
  • CoatingLayerCostReport: Extended usage of previous StandardLayerCostReport so that other reinforcements can also use it
  • +
  • Added logic to extract the surface of a layer
  • +
  • LayerCostReportProtocol;StandardLayerCostReportBuilder: Extracted standard layer cost report builder logic into separate class. Added protocol to represent the layer cost reports
  • +
  • koswat/geometries; standard_layer_cost_report: Implemented logic for StandardLayer cost calculation
  • +
  • OutsideSlopeReinforcementProfileProtocol;StandardReinforcementProfileProtocol: Added protocols to represent the different types of reinforcement - per volume; Added tests for factory
  • +
  • LayerCostReportbuilderFactory: Added logic to retrieve the corresponding LayerCostReportBuilderProtocol; Adapted tests and related imports
  • +
  • LayerCostReportBuilderFactory: Introduced layer cost report builder factory for the different types of volume calculators available
  • +
+

Fix

+
    +
  • PipingWallReinforcementProfileCalculation: Solved wrong calculation of the Length Piping Wall
  • +
  • StabilityWallReinforcementProfileCalculation: Corrected calculation of the length stability wall property
  • +
  • StabilityWall calculation was not properly mapped
  • +
  • OutsideSlopeProfileCostReportBuilder: Now we properly calculate the added core layer
  • +
  • OutsideSlopeProfileCostReportBuilder: Calculation of the 'kistdam' layers is now done properly
  • +
+

Refactor

+
    +
  • koswat/calculations: Moved calculations into their respecitve reinforcement types
  • +
  • Starting to move logic of added / removed layers to the calculation module
  • +
  • cost_report: Moved layer factory to profile factory as the logic should be in a higher level
  • +
+

v0.5.1 (2022-10-11)

+

Fix

+
    +
  • SummaryMatrixCsvExporter: We now export the locations in order of import
  • +
+

v0.5.0 (2022-10-11)

+

Feat

+
    +
  • SummaryMatrixCsvExporter: We now also export the CsvFom into a file
  • +
  • SummaryMatrixCsvFom;SummaryMatrixCsvExporter: Added Summary Matrix Csv Fom and Exporter initial logic
  • +
  • CofferDamInputProfile: Added concrete input profile for CofferDamReinforcementProfile
  • +
  • calculations/cofferdam;CofferdamReinforcementProfileCalculation;CofferdamReinforcementProfile: Added Cofferdam Reinforcement Profile and Calculation to the calculations module. Added information to the summary to also build their report.
  • +
  • StabilityWallInputProfile;StabilityWallReinforcementProfileCalculation: Created both concrete input profile and profile calculation for StabilityWallReinforcementProfile
  • +
  • StabilityWallReinforcemetnProfile: Added StabilityWallReinforcementProfile type
  • +
  • PipingWallInputProfile: Created dedicated input profile for PipingWall
  • +
  • KoswatInputProfileProtocol: Made a Koswat Input Profile protocol to manage better concrete input profiles. Adapted existing code and tests
  • +
  • PipingWallReinforcementProfileCalculation: Added calculation for PipingWall Reinforcement Profile
  • +
  • PipingWall: Added PipingWallReinforcementProfile class
  • +
  • ReinforcementProfileProtocol: Introduced ReinforcementProfileProtocol as a sub protocol of KoswatProfileProtocol. Adapted existent classes and tests. Moved existing calculations into calculations\soil
  • +
+

Fix

+
    +
  • CofferdamReinforcementProfileCalculation: P4 x coordinate set to 0 for all builds from this calculation
  • +
  • KoswatProfileBuilder: Removed paramater from build method to make it complier to the BuilderProtocol
  • +
+

v0.4.0 (2022-10-07)

+

Feat

+
    +
  • MultiLocationMultiProfileCostBuilder: Added new report to summarize reports of profile per location.
  • +
  • ListMultiLocationProfileCostBuilder: It is now possible to make a report for multiple locations and multiple possible profiles
  • +
  • KoswatBuildingsPolderside.get_classify_surroundings: We can now retrieve all points classified by their distance to the closest building
  • +
  • KoswatSurroundings: Added wrapper class for surroundings and a builder for it. Extended other koswat/surrounding builder classes to be initialized from files.
  • +
  • KoswatCsvFomBuilder;Koswat\surroundings: We can now map the csv data to surrounding points and their distances to buildings. Adapted related code
  • +
  • KoswatCsvReader: It is possible to read a CSV file into a FileObjectModelProtocol instance of KoswatCsvFom. Added new methods to fom and reader protocols, adapted related classes
  • +
  • KoswatShpReader: Added KoswatShpReader to read from a shapefile. Added reader protocol and io module
  • +
+

Refactor

+
    +
  • koswat/surroundings: Moved files into separate module
  • +
  • dike: Renamed profiles module to dike for a more coherent approach
  • +
  • cost_report: Moved directories into a better tree structure
  • +
  • koswat/cost_report: Seggregated module into builders and reports.
  • +
  • koswat/cost_report: Extracted reports into their own modules
  • +
  • ProfileCostBuilder: Profile cost builder is independent of the profile type. All types of new profiles are calculated and then a report is done for each of them"
  • +
+

v0.3.0 (2022-10-03)

+

Feat

+
    +
  • CharacteristicPoints: Created characteristic points to replace the previous 'ProtocolSide' related classes. Introduced builder to allow initial or reinforced profile creation
  • +
  • KoswatLayersBuilder: We now can create layers based on the provided depth
  • +
  • ProfileReinforcementCostBuilder: Generates a cost report for the new profile based on the extra required volume
  • +
  • KoswatReport: Added KoswatReport to generate costs overviews
  • +
  • It is now possible to create layers from a dictionary
  • +
  • koswat_layers;koswat_profile_builder: Added new class to represent the layers of a profile, their material and so on.
  • +
  • koswat/calculations: Added profile reinforcement calculation
  • +
  • koswat/profiles: Added koswat profiles and related properties. They can now be built from an input profile
  • +
+

v0.2.0 (2022-09-27)

+

Feat

+
    +
  • koswat: Initial commit. Created Initial architecture and basic tests for the structure given. Added version control through commitizen
  • +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/css/fonts/Roboto-Slab-Bold.woff b/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 00000000..6cb60000 Binary files /dev/null and b/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/css/fonts/Roboto-Slab-Bold.woff2 b/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 00000000..7059e231 Binary files /dev/null and b/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/css/fonts/Roboto-Slab-Regular.woff b/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 00000000..f815f63f Binary files /dev/null and b/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/css/fonts/Roboto-Slab-Regular.woff2 b/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 00000000..f2c76e5b Binary files /dev/null and b/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/css/fonts/fontawesome-webfont.eot b/css/fonts/fontawesome-webfont.eot new file mode 100644 index 00000000..e9f60ca9 Binary files /dev/null and b/css/fonts/fontawesome-webfont.eot differ diff --git a/css/fonts/fontawesome-webfont.svg b/css/fonts/fontawesome-webfont.svg new file mode 100644 index 00000000..855c845e --- /dev/null +++ b/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/css/fonts/fontawesome-webfont.ttf b/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 00000000..35acda2f Binary files /dev/null and b/css/fonts/fontawesome-webfont.ttf differ diff --git a/css/fonts/fontawesome-webfont.woff b/css/fonts/fontawesome-webfont.woff new file mode 100644 index 00000000..400014a4 Binary files /dev/null and b/css/fonts/fontawesome-webfont.woff differ diff --git a/css/fonts/fontawesome-webfont.woff2 b/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 00000000..4d13fc60 Binary files /dev/null and b/css/fonts/fontawesome-webfont.woff2 differ diff --git a/css/fonts/lato-bold-italic.woff b/css/fonts/lato-bold-italic.woff new file mode 100644 index 00000000..88ad05b9 Binary files /dev/null and b/css/fonts/lato-bold-italic.woff differ diff --git a/css/fonts/lato-bold-italic.woff2 b/css/fonts/lato-bold-italic.woff2 new file mode 100644 index 00000000..c4e3d804 Binary files /dev/null and b/css/fonts/lato-bold-italic.woff2 differ diff --git a/css/fonts/lato-bold.woff b/css/fonts/lato-bold.woff new file mode 100644 index 00000000..c6dff51f Binary files /dev/null and b/css/fonts/lato-bold.woff differ diff --git a/css/fonts/lato-bold.woff2 b/css/fonts/lato-bold.woff2 new file mode 100644 index 00000000..bb195043 Binary files /dev/null and b/css/fonts/lato-bold.woff2 differ diff --git a/css/fonts/lato-normal-italic.woff b/css/fonts/lato-normal-italic.woff new file mode 100644 index 00000000..76114bc0 Binary files /dev/null and b/css/fonts/lato-normal-italic.woff differ diff --git a/css/fonts/lato-normal-italic.woff2 b/css/fonts/lato-normal-italic.woff2 new file mode 100644 index 00000000..3404f37e Binary files /dev/null and b/css/fonts/lato-normal-italic.woff2 differ diff --git a/css/fonts/lato-normal.woff b/css/fonts/lato-normal.woff new file mode 100644 index 00000000..ae1307ff Binary files /dev/null and b/css/fonts/lato-normal.woff differ diff --git a/css/fonts/lato-normal.woff2 b/css/fonts/lato-normal.woff2 new file mode 100644 index 00000000..3bf98433 Binary files /dev/null and b/css/fonts/lato-normal.woff2 differ diff --git a/css/theme.css b/css/theme.css new file mode 100644 index 00000000..7e03995c --- /dev/null +++ b/css/theme.css @@ -0,0 +1,13 @@ +/* + * This file is copied from the upstream ReadTheDocs Sphinx + * theme. To aid upgradability this file should *not* be edited. + * modifications we need should be included in theme_extra.css. + * + * https://github.com/readthedocs/sphinx_rtd_theme + */ + + /* sphinx_rtd_theme version 1.0.0 | MIT license */ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,.wy-nav-top a,.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs li{display:inline-block}.wy-breadcrumbs li.wy-breadcrumbs-aside{float:right}.wy-breadcrumbs li a{display:inline-block;padding:5px}.wy-breadcrumbs li a:first-child{padding-left:0}.rst-content .wy-breadcrumbs li tt,.wy-breadcrumbs li .rst-content tt,.wy-breadcrumbs li code{padding:5px;border:none;background:none}.rst-content .wy-breadcrumbs li tt.literal,.wy-breadcrumbs li .rst-content tt.literal,.wy-breadcrumbs li code.literal{color:#404040}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.field-list>dt:after,html.writer-html5 .rst-content dl.footnote>dt:after{content:":"}html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.footnote>dt>span.brackets{margin-right:.5rem}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{font-style:italic}html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.footnote>dd p,html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{font-size:inherit;line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.field-list)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel{border:1px solid #7fbbe3;background:#e7f2fa;font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} diff --git a/css/theme_extra.css b/css/theme_extra.css new file mode 100644 index 00000000..9f4b063c --- /dev/null +++ b/css/theme_extra.css @@ -0,0 +1,191 @@ +/* + * Wrap inline code samples otherwise they shoot of the side and + * can't be read at all. + * + * https://github.com/mkdocs/mkdocs/issues/313 + * https://github.com/mkdocs/mkdocs/issues/233 + * https://github.com/mkdocs/mkdocs/issues/834 + */ +.rst-content code { + white-space: pre-wrap; + word-wrap: break-word; + padding: 2px 5px; +} + +/** + * Make code blocks display as blocks and give them the appropriate + * font size and padding. + * + * https://github.com/mkdocs/mkdocs/issues/855 + * https://github.com/mkdocs/mkdocs/issues/834 + * https://github.com/mkdocs/mkdocs/issues/233 + */ +.rst-content pre code { + white-space: pre; + word-wrap: normal; + display: block; + padding: 12px; + font-size: 12px; +} + +/** + * Fix code colors + * + * https://github.com/mkdocs/mkdocs/issues/2027 + */ +.rst-content code { + color: #E74C3C; +} + +.rst-content pre code { + color: #000; + background: #f8f8f8; +} + +/* + * Fix link colors when the link text is inline code. + * + * https://github.com/mkdocs/mkdocs/issues/718 + */ +a code { + color: #2980B9; +} +a:hover code { + color: #3091d1; +} +a:visited code { + color: #9B59B6; +} + +/* + * The CSS classes from highlight.js seem to clash with the + * ReadTheDocs theme causing some code to be incorrectly made + * bold and italic. + * + * https://github.com/mkdocs/mkdocs/issues/411 + */ +pre .cs, pre .c { + font-weight: inherit; + font-style: inherit; +} + +/* + * Fix some issues with the theme and non-highlighted code + * samples. Without and highlighting styles attached the + * formatting is broken. + * + * https://github.com/mkdocs/mkdocs/issues/319 + */ +.rst-content .no-highlight { + display: block; + padding: 0.5em; + color: #333; +} + + +/* + * Additions specific to the search functionality provided by MkDocs + */ + +.search-results { + margin-top: 23px; +} + +.search-results article { + border-top: 1px solid #E1E4E5; + padding-top: 24px; +} + +.search-results article:first-child { + border-top: none; +} + +form .search-query { + width: 100%; + border-radius: 50px; + padding: 6px 12px; /* csslint allow: box-model */ + border-color: #D1D4D5; +} + +/* + * Improve inline code blocks within admonitions. + * + * https://github.com/mkdocs/mkdocs/issues/656 + */ + .rst-content .admonition code { + color: #404040; + border: 1px solid #c7c9cb; + border: 1px solid rgba(0, 0, 0, 0.2); + background: #f8fbfd; + background: rgba(255, 255, 255, 0.7); +} + +/* + * Account for wide tables which go off the side. + * Override borders to avoid weirdness on narrow tables. + * + * https://github.com/mkdocs/mkdocs/issues/834 + * https://github.com/mkdocs/mkdocs/pull/1034 + */ +.rst-content .section .docutils { + width: 100%; + overflow: auto; + display: block; + border: none; +} + +td, th { + border: 1px solid #e1e4e5 !important; /* csslint allow: important */ + border-collapse: collapse; +} + +/* + * Without the following amendments, the navigation in the theme will be + * slightly cut off. This is due to the fact that the .wy-nav-side has a + * padding-bottom of 2em, which must not necessarily align with the font-size of + * 90 % on the .rst-current-version container, combined with the padding of 12px + * above and below. These amendments fix this in two steps: First, make sure the + * .rst-current-version container has a fixed height of 40px, achieved using + * line-height, and then applying a padding-bottom of 40px to this container. In + * a second step, the items within that container are re-aligned using flexbox. + * + * https://github.com/mkdocs/mkdocs/issues/2012 + */ + .wy-nav-side { + padding-bottom: 40px; +} + +/* + * The second step of above amendment: Here we make sure the items are aligned + * correctly within the .rst-current-version container. Using flexbox, we + * achieve it in such a way that it will look like the following: + * + * [No repo_name] + * Next >> // On the first page + * << Previous Next >> // On all subsequent pages + * + * [With repo_name] + * Next >> // On the first page + * << Previous Next >> // On all subsequent pages + * + * https://github.com/mkdocs/mkdocs/issues/2012 + */ +.rst-versions .rst-current-version { + padding: 0 12px; + display: flex; + font-size: initial; + justify-content: space-between; + align-items: center; + line-height: 40px; +} + +/* + * Please note that this amendment also involves removing certain inline-styles + * from the file ./mkdocs/themes/readthedocs/versions.html. + * + * https://github.com/mkdocs/mkdocs/issues/2012 + */ +.rst-current-version span { + flex: 1; + text-align: center; +} diff --git a/img/favicon.ico b/img/favicon.ico new file mode 100644 index 00000000..e85006a3 Binary files /dev/null and b/img/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 00000000..87fe4f18 --- /dev/null +++ b/index.html @@ -0,0 +1,212 @@ + + + + + + + + Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Koswat

+

Official documentation read the docs for Koswat

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + + Next » + + +
+ + + + + + + + + + diff --git a/installation.html b/installation.html new file mode 100644 index 00000000..385ec394 --- /dev/null +++ b/installation.html @@ -0,0 +1,262 @@ + + + + + + + + Installation - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Installation

+

Important! : The following installation steps are written based on a Windows environment. When using other systems (which should be possible) it might be required to use different commands. However, the fundamental of the installation steps should remain the same. This meaning, no additional packages or libraries should be required. If problems would arose during your installation, please contact the maintainers of the tool.

+

For users

+

When you only require the koswat package to be used as a whole, and not for developments, we advise to directly use the latest greatest release, or directly the latest available version from Master as follows:

+
    +
  1. +

    Latest available Master: +

    pip install git+https://github.com/Deltares/Koswat.git
    +

    +
  2. +
  3. +

    Specific Koswat version, add @version-tag to the previous command, for instance install tag v0.11.0 (MVP pre-release): +

    pip install git+https://github.com/Deltares/Koswat.git@v0.11.0
    +
    +| You can also do the above with a commit-hash for development branches (e.g.:@0504c06)

    +
  4. +
  5. +

    Using docker (requires checking the repository in a directory): +

    cd <your koswat checked out directory>
    +docker build -t koswat:latest -f Dockerimage .
    +docker run -it koswat bash
    +

    +
  6. +
+

For developers

+
    +
  1. +

    Checkout the code from github in a directory of your choice. You can either do this by downloading the source zip or (better) using git, for instance: +

    cd C:\repos
    +git clone https://github.com/Deltares/Koswat.git koswat
    +
    + | Note, the above steps are based on a Windows setup. If you are not familiar with Git we recommend using the GitHub desktop tool.

    +
  2. +
  3. +

    Navigate to your Koswat repository and then install the koswat package with your preferred step:

    +
      +
    1. With Miniforge (our recommendation):
      +
      cd C:\repos\koswat
      +conda env create -f .config\environment.yml
      +conda activate koswat_env
      +poetry install
      +
    2. +
    3. With pypi: +
      cd C:\repos\koswat
      +pip install .
      +
      + | Note, this will not install Poetry, which is required to properly maintain the interdependencies of Koswat tool.
    4. +
    +
  4. +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/js/html5shiv.min.js b/js/html5shiv.min.js new file mode 100644 index 00000000..1a01c94b --- /dev/null +++ b/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); diff --git a/js/jquery-3.6.0.min.js b/js/jquery-3.6.0.min.js new file mode 100644 index 00000000..c4c6022f --- /dev/null +++ b/js/jquery-3.6.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t + + + + + + + Koswat design - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Koswat design

+

In general, the architecture of this package is based on the following principles:

+ +

Component-module hierarchy

+

We cluster entities into modules (components) that represent their domain and have minimal dependencies with others components, this way the modules can be accessed when operating Koswat as a sandbox. Within each component we apply the same principle and create sub-modules to reduce dependencies.

+

At the current (unreleased) version v.0.15.0 the component hierarchy looks like follows:

+
koswat/
+
+    configuration/  # Data structures required for a koswat run.
+        geometries/
+        io/
+        settings/
+
+    core/           # Generic definitions and functionatilities.
+        geometries/
+        io/
+        protocols/
+
+    cost_report/    # Summary of costs per dike reinforcement.
+        io/
+        infrastructure/
+        multi_location_profile/
+        profile/
+        summary/
+
+    dike/           # Definition of a koswat dike.
+        characteristic_points/
+        layers/
+        material/
+        profile/
+        surroundings/
+
+    dike_reinforcements/   # Dike calculations to generate possible reinforcements.
+        input_profile/
+        io/
+        reinforcement_layers/
+        reinforcement_profile/
+
+    plots/          # Generic functionality for plotting.
+        dike/
+        geometries/
+
+    strategies/     # Different selection methods of all possible dike reinforcements alongside a dike traject.
+        order_strategy
+
+

And the components interdependencies could be slightly represented as in the following diagram:

+ + + + + + + + + + + +
Component diagram
Image 1. Component diagram
+

Inheritance

+

To facilitate the Open-Closed principle most of our classes have parameterless constructors (__init__ method). Then, to instantiate objects we often relay on the implementation of builder patterns

+

Protocols

+

In Koswat we make use of Protocols to define the required and essential properties and methods that represent an entity. Although Python does not always enforce these types as other OO languages would do (for instance C#), we try to follow and respect this principle throughought the whole repository.

+

Builder pattern

+

Check for instance this wikipedia article for a more detailed reference.

+

Because most of our classes have dependencies on other classes their initialization would require multiple steps that would become tedious and hard to maintain if they were defined in the default init method. Moreover, this approach would violate the open-closed principle.

+

Therefore, we apply the builder pattern to reduce complexity at the classes, improving maintainability and enabling future developments to create a separate builder shall the design require a different way of instantiating a given class.

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_cost_report.html b/reference/koswat_cost_report.html new file mode 100644 index 00000000..c14add17 --- /dev/null +++ b/reference/koswat_cost_report.html @@ -0,0 +1,405 @@ + + + + + + + + Cost report - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Cost report

+

A Koswat report is divided in different parts:

+
    +
  • Summary report: A summary containing all 'location reports'.
  • +
  • Location report: Which profile reinforcements can be applied to each location based on their surroundings and reinforcement properties (MultiLocationProfileCostReport).
  • +
  • Infrastructure report: (InfrastructureLocationProfileCostReport) Costs related to applying all calculated reinforcement profiles at the locations where infrastructures are present.
  • +
  • Profile report: (ProfileCostReport), what are the (material) volume costs associated when applying a given reinforced profile .
  • +
  • Layer report: A sub report of the 'profile report' which breaks down the different costs of each one of the layers. This can be seen in Image 1 Volume costs.
  • +
+ + + + + + + + + + + +
Base profile sand layer
Image 1. Volume costs
+

Infrastructure report

+

When determining the costs of infrastructures we look mainly at:

+
    +
  • The reinforcement profile (ReinforcementProfileProtocol) zones A and B.
  • +
  • The distance between a dike and an infrastructure (SurroundingsInfrastructure.points, PointSurroundings.surroundings_matrix).
  • +
+

These characteristics are then used to estimate how much surface of the infrastructures will be affected by the reinforced profile and therefore their associated cost.

+

Reinforcement profile zones

+

A reinforced profile can be different from its original state in many ways, however here we are only intestered in two things:

+
    +
  1. The new profile's width from the original waterside crest point.
  2. +
  3. Whether there is a crest's height increase (dh0),
  4. +
+

By using the old and the reinforced profile's geometries, we can determine what we call zone A and zone B, A + B = {profile's width from waterside crest point}.

+
    +
  • Zone A represents the width of the dike old profile's crest (highest surface).
  • +
  • Zone B the distance between said crest and the end of the dike's reinforcement.
  • +
+ + + + + + + + + + + +
Dike profile with zone A and B
Image 1. Reinforcement with dh0 = 0
+

However, when the crest's height of a ReinforcementProfileProtocol has increased in comparison to its original profile (ReinforcementProfileProtocol.old_profile, KoswatProfileProtocol) then we set zone A = 0 and therefore B = {profile's width from waterside crest point}.

+ + + + + + + + + + + +
Dike profile with zone B
Image 2. Reinforcement with dh0 = 1
+

Infrastructure's distances

+

An infrastructure (SurroundingsInfrastructure) can be present at different locations (SurroundingsInfrastructure.points). Each of these locations (PointSurroundings) contains a dictionary (surroundings_matrix: dict[float, float]) where the key is the distance between said location and the infrastructure and the values represent the length of the infrastructure found at that distance.

+

For instance, we could have surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5}, which means: +- Between 0 and 5 meters from the location we will find 1.5 meters of the infrastructure, +- Between 5 and 10 meters from the location we will find 0 meters of the infrastructure, +- Between 10 and 15 meters from the location we will find 2.5 meters of the infrastructure.

+

In addition, each infrastructure has a fixed width (SurroundingsInfrastructure.infrastructure_width), which can later be used to calculate the total surface of said infrastructure affected by the given profile. So: affected_infra_zone_x = meters_of_infrastructure_in_zone_x * infrastructure_width, where meters_of_infrastructure_in_zone_x are the values calculated from the surroundings_matrix and infrastructure_width is the infrastructure fixed width.

+

Cost calculation

+

After defining the profile's zones A and B we can easily find how much of each infrastructures is affected by checking the surroundings_matrix indices and "rounding" up. It is agreed that at the overlapping points between A and B, the affected surface, and therefore costs, will only be computed for zone A; this is done regardless of the chosen infrastructure costs type (InfraCostsEnum).

+

Once the total area is known, we only need to multiply them by their related costs for adding and/or removing infrastructure's material.

+

Example

+

Using as example the previous surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5} we can demostrate this when A = 4 and B = 10.

+
    +
  1. Estimate zone limits:
      +
    • zone_a goes from 0 to 4,
    • +
    • zone_b goes from 4 to 14.
    • +
    +
  2. +
  3. Estimate affected points in the surroundings matrix:
      +
    • zone_a affects only up until key 5, so 1.5 meters of infrastructure.
    • +
    • zone_b affects keys 10 and 15, so 2.5 meters of infrastructure.
        +
      • Note that we do not take 5 as has already been considered for zone_a.
      • +
      +
    • +
    +
  4. +
+

Generated files

+

After running a Koswat analysis, several files and directories will be generated. Usually the structure will be as follows:

+

Dike profile section scenarios -> Scenario -> Generated files

+
    +
  • Dike profile - scenarios directory: Each dike can be run using different scenarios.
  • +
  • Scenario: Scenario being applied to the selected dike profile.
  • +
  • Dike section: The selected dike section being analyzed.
  • +
  • Generated files: A combination of images and a 'csv' matrix result.
      +
    • Images: Visual description of each of the possible reinforcements being applied.
    • +
    • summary_costs.csv: A csv file containing all the costs information of the summary.
        +
      • Represents the Summary, Profile and Layer report.
      • +
      +
    • +
    • summary_locations.csv: A csv file containing per-location a breakdown of available reinforcements and selected reinforcement ( see strategies).
        +
      • Represents the Location report.
      • +
      +
    • +
    • /summary_locations directory: contains the following .shp files (and their related binaries): + -summary_locations_measures: The same data as present in summary_locations.csv is used to shape the geometry of a dike's traject. We keep as well the type of chosen reinforcement.
        +
      • summary_locations_new: an overlay of summary_locations_measures with the geometry buffered in relation to the new selected reinforcement.
      • +
      • summary_locations_old: an overlay of summary_locations_measures with the geometry buffered in relation to the original selected reinforcement.
      • +
      • summary_locations_step: an overlay of summary_locations_measures with the geometry buffered in relation to the Ordered Strategy step.
      • +
      +
    • +
    • summary_infrastructure_costs.csv: A csv file contaning all the infrastructure costs at each location for each of the supported reinforcement profile types. +
    • +
    +
  • +
+

Example using a summarized view of the output tree directory when running the acceptance test test_main.test_given_valid_input_succeeds: +

acceptance
+|   koswat.log
+|
++-- results_output
+|   +-- dike_10-1-1-A-1-A
+|   |   +-- scenario_scenario1
+|   |   |   |   Grondmaatregel_profiel.png
+|   |   |   |   Kistdam.png
+|   |   |   |   Kwelscherm.png
+|   |   |   |   summary_costs.csv
+|   |   |   |   summary_locations.csv
+|   |   |   |   summary_infrastructure_costs.csv
+|   |   |   |   Stabiliteitswand.png
+|   |   |   |   Verticale_piping_oplossing.png
+|   |   |   |
+|   |   |   +-- summary_locations
+|   |   |       |   summary_locations_measures.cpg
+|   |   |       |   summary_locations_measures.dbf
+|   |   |       |   summary_locations_measures.prj
+|   |   |       |   summary_locations_measures.shp
+|   |   |       |   summary_locations_measures.shx
+|   |   |       |   summary_locations_new.cpg
+|   |   |       |   summary_locations_new.dbf
+|   |   |       |   summary_locations_new.prj
+|   |   |       |   summary_locations_new.shp
+|   |   |       |   summary_locations_new.shx
+|   |   |       |   summary_locations_old.cpg
+|   |   |       |   summary_locations_old.dbf
+|   |   |       |   summary_locations_old.prj
+|   |   |       |   summary_locations_old.shp
+|   |   |       |   summary_locations_step.shx
+|   |   |       |   summary_locations_step.cpg
+|   |   |       |   summary_locations_step.dbf
+|   |   |       |   summary_locations_step.prj
+|   |   |       |   summary_locations_step.shp
+|   |   |       |   summary_locations_step.shx
+|   |   |   +-- Grondmaatregel_profiel
+|   |   |       |   added_Grondmaatregel_profiel_CLAY.png
+|   |   |       |   added_Grondmaatregel_profiel_GRASS.png
+|   |   |       |   added_Grondmaatregel_profiel_SAND.png
+|   |   |       |   removed_Grondmaatregel_profiel_CLAY.png
+|   |   |       |   removed_Grondmaatregel_profiel_GRASS.png
+|   |   |   +-- Kistdam
+|   |   |       |   ...
+|   |   |
+|   |   |   +-- Kwelscherm
+|   |   |       |   ...
+|   |   |
+|   |   |   +-- Stabiliteitswand
+|   |   |       |   ...
+|   |   |
+|   |   |   +-- Verticale_piping_oplossing
+|   |   |       |   ...
+|   |   |
+|   |   +-- scenario_scenario2
+|   |       |   ...
+

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_dike.html b/reference/koswat_dike.html new file mode 100644 index 00000000..dc0d5ae3 --- /dev/null +++ b/reference/koswat_dike.html @@ -0,0 +1,300 @@ + + + + + + + + Dike profile - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Dike profile

+

In this section we will describe how a Koswat dike is defined and what its parts are.

+

Koswat properties

+

A koswat dike is represented by an instance of a KoswatProfileProtocol. And its properties represent different aspects of a 'real domain'. With Image 1. Base profile properties as reference, we can see the mapping between said 'real domain' and the koswat properties:

+
    +
  • input_data: The parts of a dike (written on the image reference), which are directly mapped as an implementation of the KoswatInputProfileProtocol.
  • +
  • characteristic_points: 8 points given by the user describing the dike on (x,y) coordinates, the first four represent the waterside (buitendijks), the last four the polderside (binnendijks). Numbered in the reference picture from 1 to 8. Point 4 is considered to be the reference value (0) with respect to distances of e.g. surroundings and widths of certain parts of the dike.
  • +
  • layers_wrapper: The description on how the layers of the dike are built. Further described in Dike layers.
  • +
  • location: Geospatial coordinates (x, y) where the dike is situated.
  • +
  • profile_width: The difference between the lowest and the highest 'x' coordinates of the profile characteristic points. The distance between characteristic points 1 and 8. This can be broken down into:
  • +
  • waterside_width: The distance between characteristics points 1 and 4.
  • +
  • polderside_width: The distance between characteristics points 4 and 8.
  • +
+ + + + + + + + + + + +
Base profile properties
Image 1. Base profile properties
+

The geometry of a dike has certain additional characteristics: +- crest (kruin): The flat part on top of the dike. +- berm (berm): The flat part between either point 2 and 3 (waterside) or point 6 an 7 (polderside). +- slope (talud): The (steepness of the) diagonal parts between points 1 and 4 (waterside) or points 5 and 8 (polderside). +- ground level (maaiveld): The level of the area to the left of point 1 (waterside) or to the right of point 8 (polderside).

+

Dike layers

+

A dike is composed by three layers:

+
    +
  • Sand, the core layer.
  • +
  • Clay, a coating layer.
  • +
  • Grass, a (top) coating layer.
  • +
+

These layers are wrapped under a KoswatLayersWrapperProtocol instance. At the same time, each layer is an instance of a KoswatLayerProtocol containing the following properties:

+
    +
  • material_type: Either Sand, Clay or Grass.
  • +
  • upper_points: The surface points of the layer. This property can be used to calculate the surface (m2) of a material.
  • +
  • outer_geometry: A polygon representing the material layer and the 'wrapped' polygons. For instance, the Clay outer_geometry will also include the Sand material_geometry.
  • +
  • material_geometry: A closed polygon containing only the points representing the layer.
  • +
+

Using Image 3. Clay layer highlighted as an example, we can map the previous properties:

+
    +
  • material_type: Clay, the 'in-between' layer.
  • +
  • upper_points: Line with the 'orange' points, without 'closing' the polygon, something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0)].
  • +
  • outer_geometry: Closed geometry using the upper points and the 'ground level' (maaiveld) points: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (-18, 0)].
  • +
  • material_geometry: Closed geometry using the upper_points from Clay and the upper_points from the layer below (Sand, green points). Should be something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (19, 0), (8, 4.75), (0, 4.75), (-14, 0), (-18, 0)]
  • +
+ + + + + + + + + + + +
Base profile sand layer
Image 2. Sand layer highlighted
+ + + + + + + + + + + +
Base profile clay layer
Image 3. Clay layer highlighted
+ + + + + + + + + + + +
Base profile grass layer
Image 4. Grass layer highlighted
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/configuration/koswat_config_protocol.html b/reference/koswat_docstrings/configuration/koswat_config_protocol.html new file mode 100644 index 00000000..9aaaf5ce --- /dev/null +++ b/reference/koswat_docstrings/configuration/koswat_config_protocol.html @@ -0,0 +1,344 @@ + + + + + + + + Koswat Config Protocol - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • Reference »
  • +
  • Koswat docstrings »
  • +
  • Configuration »
  • +
  • Koswat Config Protocol
  • +
  • + Edit on Deltares/koswat +
  • +
+
+
+
+
+ +

Koswat Config Protocol

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ DataObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.

+ + + +
+ +
+ + + + + + +
+ + + +

+ KoswatConfigProtocol + + +

+ + +
+

+ Bases: DataObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the current KoswatConfigProtocol instance.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

True when the current instance is valid to be used as a configuration class.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/core/geometries.html b/reference/koswat_docstrings/core/geometries.html new file mode 100644 index 00000000..bd9169ad --- /dev/null +++ b/reference/koswat_docstrings/core/geometries.html @@ -0,0 +1,886 @@ + + + + + + + + Core geometries module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Core geometries module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+as_unified_geometry(source_geom: geometry.Polygon | geometry.MultiPolygon) -> geometry.Polygon + +

+ + +
+ +

Ensures the calculated geometry is returned as a single polygon.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
source_geom + geometry.Polygon | geometry.MultiPolygon +

Calculated source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon +

geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate).

+ +
+ +
+ + + + + + +
+ + + +

+get_groundlevel_surface(pol_geometry: geometry.Polygon) -> geometry.LineString + +

+ + +
+ +

Returns all the points which are at 'groundlevel' values (y = 0)

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
pol_geometry + geometry.Polygon +

Source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Line with points at y = 0.

+ +
+ +
+ + + + + + +
+ + + +

+get_normalized_polygon_difference(left_geom: geometry.Polygon, right_geom: geometry.Polygon) -> geometry.Polygon | geometry.MultiPolygon + +

+ + +
+ +

Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
left_geom + geometry.Polygon +

Base polygon from where to substract.

+ required +
right_geom + geometry.Polygon +

Polygon to substract from base.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon | geometry.MultiPolygon +

geometry.Polygon: Resulting normalized substraction polygon.

+ +
+ +
+ + + + + + +
+ + + +

+get_polygon_coordinates(pol_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Given a single or multi geometry returns the coordinates composing its outer layout.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
pol_geometry + geometry.Polygon | geometry.MultiPolygon +

Source geometry.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

When the provided geometry is not yet supported.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Set of points composing the outer layout of the geometry.

+ +
+ +
+ + + + + + +
+ + + +

+get_polygon_surface_points(base_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Gets all the points composing the upper surface of a 'dike' geometry. +IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
base_geometry + Union[geometry.Polygon, geometry.MultiPolygon] +

Source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Resulting line with points from the outer geometry.

+ +
+ +
+ + + + + + +
+ + + +

+get_relative_core_layer(core_geometry: geometry.Polygon, coating_geometry: geometry.Polygon) -> geometry.Polygon + +

+ + +
+ +

Returns a new 'core' from the original core_geometry relative to the coating_geometry.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
core_geometry + Polygon +

Original core geometry on which layers are stacked upon.

+ required +
coating_geometry + Polygon +

Layer wrapping the exterior of a core geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Polygon + geometry.Polygon +

Layer wrapping a reduced surface of the core_geometry.

+ +
+ +
+ + + + + + +
+ + + +

+order_geometry_points(dike_polygon: geometry.Polygon) -> geometry.Polygon + +

+ + +
+ +

In koswat we handle polygon operations expecting the lowest 'x' coordinate to be the initial and last point of a geometry. +For this reason we need to ensure all geometries are 'normalized' based on this criteria.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
dike_polygon + geometry.Polygon +

Polygon to normalized.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon +

geometry.Polygon: Normalized polygon.

+ +
+ +
+ + + + + + +
+ + + +

+profile_points_to_polygon(points_list: list[geometry.Point]) -> geometry.Polygon + +

+ + +
+ +

Transforms a list of points into a valid 'dike' polygon. When there is a difference in height between left and right side then we correct it in the x = 0 coordinate.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
points_list + List[geometry.Point] +

List of points representing a dike profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon +

geometry.Polygon: Validated enclosed geometry simple polygon.

+ +
+ +
+ + + + + + +
+ + + +

+remove_layer_from_polygon(dike_polygon: geometry.Polygon, layer_depth: float) -> geometry.Polygon + +

+ + +
+ +

Gets the dike profile without a layer of provided layer_depth depth.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
dike_polygon + geometry.Polygon +

Source geometry.

+ required +
layer_depth + float +

Depth of a layer from the outer dike_polygon geometry inwards.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon +

geometry.Polygon: Resulting geometry when removing the layer.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/core/io.html b/reference/koswat_docstrings/core/io.html new file mode 100644 index 00000000..cf8e5595 --- /dev/null +++ b/reference/koswat_docstrings/core/io.html @@ -0,0 +1,2671 @@ + + + + + + + + Input Output core module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Input Output core module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ DataObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.

+ + + +
+ +
+ + + + + + +
+ + + +

+ KoswatImporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+import_from(from_path: Path) -> Union[DataObjectModelProtocol, List[DataObjectModelProtocol]] + +

+ + +
+ +

Generates a valid instance of a DataObjectModelProtocol based on the contents from the provided path.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
from_path + Path +

Path containing data to be read.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ Union[DataObjectModelProtocol, List[DataObjectModelProtocol]] +

Union[DataObjectModelProtocol, List[DataObjectModelProtocol]]: Either a single valid instance of a DataObjectModelProtocol or a list of them.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatReaderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+read(file_path: Path) -> FileObjectModelProtocol + +

+ + +
+ +

Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
FileObjectModelProtocol + FileObjectModelProtocol +

Model representing the data in the file.

+ +
+ +
+ + + + + + +
+ + + +

+supports_file(file_path: Path) -> bool + +

+ + +
+ +

Validates whether the current reader is capable of importing data from the provided file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatWriterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+write(fom_instance: FileObjectModelProtocol, to_path: Path) -> None + +

+ + +
+ +

Writes the data from the instance of a FileObjectModelProtocol to the to_path.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
fom_instance + FileObjectModelProtocol +

Instance with data to write.

+ required +
to_path + Path +

Path to file (or directory) where to write the data.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

CSV module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatCsvFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the current structure of this KoswatCsvFomProtocol instance.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

True when is a valid FOM.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatCsvFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the current structure of this KoswatCsvFomProtocol instance.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

True when is a valid FOM.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatReaderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+read(file_path: Path) -> FileObjectModelProtocol + +

+ + +
+ +

Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
FileObjectModelProtocol + FileObjectModelProtocol +

Model representing the data in the file.

+ +
+ +
+ + + + + + +
+ + + +

+supports_file(file_path: Path) -> bool + +

+ + +
+ +

Validates whether the current reader is capable of importing data from the provided file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatCsvFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the current structure of this KoswatCsvFomProtocol instance.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

True when is a valid FOM.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatWriterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+write(fom_instance: FileObjectModelProtocol, to_path: Path) -> None + +

+ + +
+ +

Writes the data from the instance of a FileObjectModelProtocol to the to_path.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
fom_instance + FileObjectModelProtocol +

Instance with data to write.

+ required +
to_path + Path +

Path to file (or directory) where to write the data.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

INI module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatIniFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+from_config(ini_config: ConfigParser) -> KoswatIniFomProtocol + + + classmethod + + +

+ + +
+ +

Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
ini_config + ConfigParser +

Dictionary containing Ini values (section - properties, property - value) to be parsed.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatIniFomProtocol + KoswatIniFomProtocol +

Valid instance of a KoswatIniFomProtocol with the provided values.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatIniFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+from_config(ini_config: ConfigParser) -> KoswatIniFomProtocol + + + classmethod + + +

+ + +
+ +

Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
ini_config + ConfigParser +

Dictionary containing Ini values (section - properties, property - value) to be parsed.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatIniFomProtocol + KoswatIniFomProtocol +

Valid instance of a KoswatIniFomProtocol with the provided values.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatReaderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+read(file_path: Path) -> FileObjectModelProtocol + +

+ + +
+ +

Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
FileObjectModelProtocol + FileObjectModelProtocol +

Model representing the data in the file.

+ +
+ +
+ + + + + + +
+ + + +

+supports_file(file_path: Path) -> bool + +

+ + +
+ +

Validates whether the current reader is capable of importing data from the provided file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

TXT module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatTxtFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+from_text(file_text: str) -> KoswatTxtFomProtocol + + + classmethod + + +

+ + +
+ +

Imports all the data stored in text form.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_text + str +

Raw data in string format.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatTxtFomProtocol + KoswatTxtFomProtocol +

Valid instance of a KoswatTxtFomProtocol with the provided values.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatReaderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+read(file_path: Path) -> FileObjectModelProtocol + +

+ + +
+ +

Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
FileObjectModelProtocol + FileObjectModelProtocol +

Model representing the data in the file.

+ +
+ +
+ + + + + + +
+ + + +

+supports_file(file_path: Path) -> bool + +

+ + +
+ +

Validates whether the current reader is capable of importing data from the provided file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_path + Path +

Path to a file that should be imported.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatTxtFomProtocol + + +

+ + +
+

+ Bases: FileObjectModelProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+from_text(file_text: str) -> KoswatTxtFomProtocol + + + classmethod + + +

+ + +
+ +

Imports all the data stored in text form.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
file_text + str +

Raw data in string format.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatTxtFomProtocol + KoswatTxtFomProtocol +

Valid instance of a KoswatTxtFomProtocol with the provided values.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/core/koswat_logger.html b/reference/koswat_docstrings/core/koswat_logger.html new file mode 100644 index 00000000..ad7a5705 --- /dev/null +++ b/reference/koswat_docstrings/core/koswat_logger.html @@ -0,0 +1,270 @@ + + + + + + + + Koswat logger - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Koswat logger

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLogger + + +

+ + +
+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/core/protocols.html b/reference/koswat_docstrings/core/protocols.html new file mode 100644 index 00000000..8624d95c --- /dev/null +++ b/reference/koswat_docstrings/core/protocols.html @@ -0,0 +1,364 @@ + + + + + + + + Core protocols module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Core protocols module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ DataObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.

+ + + +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/cost_report.html b/reference/koswat_docstrings/cost_report.html new file mode 100644 index 00000000..58a612c0 --- /dev/null +++ b/reference/koswat_docstrings/cost_report.html @@ -0,0 +1,6886 @@ + + + + + + + + Cost report module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Cost report module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ CostReportProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

A Protocol defining the properties of a report in Koswat.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Infrastructure cost calculator

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ProfileZoneCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator to determine the width of zones A and B of a reinforced +profile (ReinforcementProfileProtocol). It requires its original base +profile to be in its definition.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate() -> tuple[float, float] + +

+ + +
+ +

Calculates the width of zones A and B for the defined instance of +ReinforcementProfileProtocol. The calculation is as follows: +- When dh0 has not varied with respect to the base profile, then zones +A and B are calculated. +- When dh0 has increased then only zone B is calculated.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Calculated zone A and B respectively.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ InfrastructureLocationCosts + + + + dataclass + + +

+ + +
+ + +

Simple data structure containing the results of the costs calculations +for a given ReinforcementProfileProtocol profile. +The values related to zone_a and zone_b are calculated in the +ProfileZoneCalculator.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfrastructureProfileCostsCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator to generate all InfrastructureLocationCosts instances +based on the locations of the contained infrastructure +(SurroundingsInfrastructure.points) and the width of zone_a and +zone_b.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate(zone_a_width: float, zone_b_width: float) -> list[InfrastructureLocationCosts] + +

+ + +
+ +

Calculates the costs affecting this instance's infrastructure +at all points where it is present.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
zone_a_width + float +

Width of zone type A.

+ required +
zone_b_width + float +

Width of zone type `B .

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[InfrastructureLocationCosts] +

list[InfrastructureLocationCosts]: Resulting cost summaries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsInfrastructure + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that can be repaired or replaced.

+

The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a float representing +how long that infrastructure is.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ InfrastructureProfileCostsCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator to generate all InfrastructureLocationCosts instances +based on the locations of the contained infrastructure +(SurroundingsInfrastructure.points) and the width of zone_a and +zone_b.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate(zone_a_width: float, zone_b_width: float) -> list[InfrastructureLocationCosts] + +

+ + +
+ +

Calculates the costs affecting this instance's infrastructure +at all points where it is present.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
zone_a_width + float +

Width of zone type A.

+ required +
zone_b_width + float +

Width of zone type `B .

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[InfrastructureLocationCosts] +

list[InfrastructureLocationCosts]: Resulting cost summaries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ MultiInfrastructureProfileCostsCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator that contains all possible "infrastructure" calculators +(InfrastructureProfileCostsCalculator) one for each of the available +infrastructures in the current KoswatScenario. +Its calculate method only requires a reinforcement +(ReinforcementProfileProtocol) to determine all infrastructures' costs.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate(reinforced_profile: ReinforcementProfileProtocol) -> list[InfrastructureLocationProfileCostReport] + +

+ + +
+ +

Calculates the costs related to appyling the provided reinforcement_profile +at all the locations where an infrastructure is present. It first determines +zone A and B and then provides their widths to the inner +infrastructure calculators (InfrastructureProfileCostsCalculator).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforced_profile + ReinforcementProfileProtocol +

Reinforcement to be applied.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[InfrastructureLocationProfileCostReport] +

list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ProfileZoneCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator to determine the width of zones A and B of a reinforced +profile (ReinforcementProfileProtocol). It requires its original base +profile to be in its definition.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate() -> tuple[float, float] + +

+ + +
+ +

Calculates the width of zones A and B for the defined instance of +ReinforcementProfileProtocol. The calculation is as follows: +- When dh0 has not varied with respect to the base profile, then zones +A and B are calculated. +- When dh0 has increased then only zone B is calculated.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Calculated zone A and B respectively.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfrastructureProfileCostsCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator to generate all InfrastructureLocationCosts instances +based on the locations of the contained infrastructure +(SurroundingsInfrastructure.points) and the width of zone_a and +zone_b.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate(zone_a_width: float, zone_b_width: float) -> list[InfrastructureLocationCosts] + +

+ + +
+ +

Calculates the costs affecting this instance's infrastructure +at all points where it is present.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
zone_a_width + float +

Width of zone type A.

+ required +
zone_b_width + float +

Width of zone type `B .

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[InfrastructureLocationCosts] +

list[InfrastructureLocationCosts]: Resulting cost summaries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ MultiInfrastructureProfileCostsCalculator + + + + dataclass + + +

+ + +
+ + +

Calculator that contains all possible "infrastructure" calculators +(InfrastructureProfileCostsCalculator) one for each of the available +infrastructures in the current KoswatScenario. +Its calculate method only requires a reinforcement +(ReinforcementProfileProtocol) to determine all infrastructures' costs.

+ + + + + +
+ + + + + + + +
+ + + +

+calculate(reinforced_profile: ReinforcementProfileProtocol) -> list[InfrastructureLocationProfileCostReport] + +

+ + +
+ +

Calculates the costs related to appyling the provided reinforcement_profile +at all the locations where an infrastructure is present. It first determines +zone A and B and then provides their widths to the inner +infrastructure calculators (InfrastructureProfileCostsCalculator).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforced_profile + ReinforcementProfileProtocol +

Reinforcement to be applied.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[InfrastructureLocationProfileCostReport] +

list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ MultiInfrastructureProfileCostsCalculatorBuilder + + + + dataclass + + +

+ + +
+

+ Bases: BuilderProtocol

+ + +

Builder to set up "fix" information such as costs derived from the koswat +settings (InfraCostsEnum, SurtaxFactorEnum) which directly determines the +zone A and/or B costs that will be applied for each infrastructure.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsInfrastructure + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that can be repaired or replaced.

+

The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a float representing +how long that infrastructure is.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Quantity cost parameters calculator

+ + +
+ + + +
+ + + +
+ + + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ CostParameterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+total_cost: float + + + property + + +

+ + +
+ +

The total cost (quantity * unit cost)

+
+ +
+ + + + + + +
+ + + +

+total_cost_with_surtax: float + + + property + + +

+ + +
+ +

The total cost including surtaxes

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

IO

+

Summary

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

Summary costs

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ CostParameterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+total_cost: float + + + property + + +

+ + +
+ +

The total cost (quantity * unit cost)

+
+ +
+ + + + + + +
+ + + +

+total_cost_with_surtax: float + + + property + + +

+ + +
+ +

The total cost including surtaxes

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Summary infrastructure costs

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SummaryInfrastructureCostsCsvFomBuilder + + + + dataclass + + +

+ + +
+

+ Bases: BuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfrastructureLocationCosts + + + + dataclass + + +

+ + +
+ + +

Simple data structure containing the results of the costs calculations +for a given ReinforcementProfileProtocol profile. +The values related to zone_a and zone_b are calculated in the +ProfileZoneCalculator.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ MultiLocationProfileCostReport + + + + dataclass + + +

+ + +
+

+ Bases: CostReportProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+get_infra_costs_per_location() -> dict[PointSurroundings, tuple[float, float]] + +

+ + +
+ +

Gets the total costs related to infrastructures at each of the points for +the profile type in profile_cost_report

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[PointSurroundings, tuple[float, float]] +

dict[PointSurroundings, tuple[float, float]]: Total cost per location (without and with surtax).

+ +
+ +
+ + + + + + +
+ + + +

+total_cost: float + + + property + + +

+ + +
+ +

Calculates the cost of the measure for all possible locations, +regardless whether that measure is chosen by the order strategy or not.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SummaryInfrastructureCostsCsvFomBuilder + + + + dataclass + + +

+ + +
+

+ Bases: BuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Summary locations

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ClusterShpFom + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+base_geometry: LineString + + + property + + +

+ + +
+ +

The resulting geometry of all locations excluding the +profile's width.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
LineString + LineString +

Geometry representing the cluster coordinates.

+
+ +
+ + + + + + +
+ + + +

+get_buffered_geometry(width: float) -> LineString + +

+ + +
+ +

The base_geometry with an applied buffer (width) that +represents the polderside's width.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
width + float +

Profile's polderside width.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
LineString + LineString +

Resulting base_geometry with a buffer.

+ +
+ +
+ + + + + + +
+ + + +

+new_profile_width: float + + + property + + +

+ + +
+ +

The new polderside width.

+
+ +
+ + + + + + +
+ + + +

+old_profile_width: float + + + property + + +

+ + +
+ +

The original polderside width.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ClusterCollectionShpFom + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+from_summary(koswat_summary: KoswatSummary, cluster_criteria: Callable[[StrategyLocationReinforcement], type[ReinforcementProfileProtocol]] = lambda x: x.current_selected_measure) -> ClusterCollectionShpFom + + + classmethod + + +

+ + +
+ +

Maps the KoswatSummary into a file object model that can be exported into *.shp files.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
koswat_summary + KoswatSummary +

The summary containing the information to export.

+ required +
]) +

(Lambda) Function criteria to group the locations by reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ClusterCollectionShpFom + ClusterCollectionShpFom +

Dataclass instance that can be directly exported into .shp.

+ +
+ +
+ + + + + + +
+ + + +

+generate_geodataframes() -> ClusterGeoDataFrameOutputFom + +

+ + +
+ +

Generates all geodataframes of the given clusters. The generated geodataframes +correspond to the, base geometry (without buffering), the old and new geometries +with their profile's width being buffered to the base geometry.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ClusterGeoDataFrameOutputFom + ClusterGeoDataFrameOutputFom +

Resulting geodataframes wrapper maping this ClusterCollectionShpFom.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ClusterGeoDataFrameOutputFom + + +

+ + +
+

+ Bases: FileObjectModelProtocol

+ + +

Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes.

+ + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Checks that all GeoDataFrame properties are set.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Validation result.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ClusterShpFom + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+base_geometry: LineString + + + property + + +

+ + +
+ +

The resulting geometry of all locations excluding the +profile's width.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
LineString + LineString +

Geometry representing the cluster coordinates.

+
+ +
+ + + + + + +
+ + + +

+get_buffered_geometry(width: float) -> LineString + +

+ + +
+ +

The base_geometry with an applied buffer (width) that +represents the polderside's width.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
width + float +

Profile's polderside width.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
LineString + LineString +

Resulting base_geometry with a buffer.

+ +
+ +
+ + + + + + +
+ + + +

+new_profile_width: float + + + property + + +

+ + +
+ +

The new polderside width.

+
+ +
+ + + + + + +
+ + + +

+old_profile_width: float + + + property + + +

+ + +
+ +

The original polderside width.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ClusterGeoDataFrameOutputFom + + +

+ + +
+

+ Bases: FileObjectModelProtocol

+ + +

Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes.

+ + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Checks that all GeoDataFrame properties are set.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Validation result.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ FileObjectModelProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Verifies if the current object is valid for import / export.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Result of the validation.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ClusterCollectionShpFom + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+from_summary(koswat_summary: KoswatSummary, cluster_criteria: Callable[[StrategyLocationReinforcement], type[ReinforcementProfileProtocol]] = lambda x: x.current_selected_measure) -> ClusterCollectionShpFom + + + classmethod + + +

+ + +
+ +

Maps the KoswatSummary into a file object model that can be exported into *.shp files.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
koswat_summary + KoswatSummary +

The summary containing the information to export.

+ required +
]) +

(Lambda) Function criteria to group the locations by reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ClusterCollectionShpFom + ClusterCollectionShpFom +

Dataclass instance that can be directly exported into .shp.

+ +
+ +
+ + + + + + +
+ + + +

+generate_geodataframes() -> ClusterGeoDataFrameOutputFom + +

+ + +
+ +

Generates all geodataframes of the given clusters. The generated geodataframes +correspond to the, base geometry (without buffering), the old and new geometries +with their profile's width being buffered to the base geometry.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ClusterGeoDataFrameOutputFom + ClusterGeoDataFrameOutputFom +

Resulting geodataframes wrapper maping this ClusterCollectionShpFom.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/dike/layers.html b/reference/koswat_docstrings/dike/layers.html new file mode 100644 index 00000000..68d0b3eb --- /dev/null +++ b/reference/koswat_docstrings/dike/layers.html @@ -0,0 +1,1006 @@ + + + + + + + + Dike layers module. - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Dike layers module.

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayerBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> KoswatLayerProtocol + +

+ + +
+ +

Builds an instance of a KoswatLayerProtocol based on the provided upper_linestring and layer_data

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayerProtocol + KoswatLayerProtocol +

Valid instance of a KoswatLayerProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

Layers wrapper

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> KoswatLayersWrapperProtocol + +

+ + +
+ +

Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayersWrapperProtocol + KoswatLayersWrapperProtocol +

Valid initialized instance of a KoswatLayersWrapperProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/dike/profile.html b/reference/koswat_docstrings/dike/profile.html new file mode 100644 index 00000000..4e3f062d --- /dev/null +++ b/reference/koswat_docstrings/dike/profile.html @@ -0,0 +1,493 @@ + + + + + + + + Koswat dike profile module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • Reference »
  • +
  • Koswat docstrings »
  • +
  • Dike »
  • +
  • Koswat dike profile module
  • +
  • + Edit on Deltares/koswat +
  • +
+
+
+
+
+ +

Koswat dike profile module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: List[KoswatLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ List[KoswatLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/dike/surroundings.html b/reference/koswat_docstrings/dike/surroundings.html new file mode 100644 index 00000000..d8ddae76 --- /dev/null +++ b/reference/koswat_docstrings/dike/surroundings.html @@ -0,0 +1,2733 @@ + + + + + + + + Koswat dike surroundings - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Koswat dike surroundings

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatSurroundingsProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatSurroundingsProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsInfrastructure + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that can be repaired or replaced.

+

The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a float representing +how long that infrastructure is.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatSurroundingsProtocol + + +

+ + +
+

+ Bases: Protocol

+ + +

Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsObstacle + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that cannot be repaired or replaced. +The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a 1 (obstacle present) +or a 0 (obstacle not present).

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Point

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundingsListPoldersideBuilder + + + + dataclass + + +

+ + +
+

+ Bases: BuilderProtocol

+ + +

Builds a collection of points (list[PointSurroundings]) given the dike locations +(KoswatDikeLocationsShpFom) and the surroundings around it +(KoswatSurroundingsCsvFom).

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Wrapper

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ObstacleSurroundingsWrapper + + + + dataclass + + +

+ + +
+

+ Bases: BaseSurroundingsWrapper

+ + + + + + +
+ + + + + + + +
+ + + +

+get_locations_at_safe_distance(distance: float) -> list[PointSurroundings] + +

+ + +
+ +

Gets all locations which are safe from obstacle surroundings in a radius of distance.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
distance + float +

Radius from each point that should be free of surroundings.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[PointSurroundings] +

list[PointSurroundings]: List of safe locations (points with surroundings).

+ +
+ +
+ + + + + + +
+ + + +

+obstacle_locations: list[PointSurroundings] + + + property + + +

+ + +
+ +

Overlay of locations of the different ObstacleSurroundings that are present. +Buildings need to be present as input (leading for location coordinates). +Each location represents 1 meter in a real scale map.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[PointSurroundings] +

list[PointSurroundings]: List of locations with only the closest distance to obstacle(s).

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsWrapper + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+get_locations_at_safe_distance(distance: float) -> list[PointSurroundings] + +

+ + +
+ +

Gets all locations which are safe from obstacle surroundings in a radius of distance.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
distance + float +

Radius from each point that should be free of surroundings.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[PointSurroundings] +

List[PointSurroundings]: List of safe locations (points with surroundings).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BaseSurroundingsWrapper + + +

+ + +
+

+ Bases: ABC

+ + + + + + +
+ + + + + + + +
+ + + +

+surroundings_collection: dict[str, KoswatSurroundingsProtocol] + + + property + + +

+ + +
+ +

The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[str, KoswatSurroundingsProtocol] +

dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsInfrastructure + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that can be repaired or replaced.

+

The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a float representing +how long that infrastructure is.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BaseSurroundingsWrapper + + +

+ + +
+

+ Bases: ABC

+ + + + + + +
+ + + + + + + +
+ + + +

+surroundings_collection: dict[str, KoswatSurroundingsProtocol] + + + property + + +

+ + +
+ +

The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[str, KoswatSurroundingsProtocol] +

dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ObstacleSurroundingsWrapper + + + + dataclass + + +

+ + +
+

+ Bases: BaseSurroundingsWrapper

+ + + + + + +
+ + + + + + + +
+ + + +

+get_locations_at_safe_distance(distance: float) -> list[PointSurroundings] + +

+ + +
+ +

Gets all locations which are safe from obstacle surroundings in a radius of distance.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
distance + float +

Radius from each point that should be free of surroundings.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[PointSurroundings] +

list[PointSurroundings]: List of safe locations (points with surroundings).

+ +
+ +
+ + + + + + +
+ + + +

+obstacle_locations: list[PointSurroundings] + + + property + + +

+ + +
+ +

Overlay of locations of the different ObstacleSurroundings that are present. +Buildings need to be present as input (leading for location coordinates). +Each location represents 1 meter in a real scale map.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[PointSurroundings] +

list[PointSurroundings]: List of locations with only the closest distance to obstacle(s).

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SurroundingsObstacle + + + + dataclass + + +

+ + +
+

+ Bases: KoswatSurroundingsProtocol

+ + +

Defines surroundings point collections that cannot be repaired or replaced. +The PointSurroundings contain a matrix (dictionary) where the keys +represent the distances to an obstacle, and the values a 1 (obstacle present) +or a 0 (obstacle not present).

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html b/reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html new file mode 100644 index 00000000..80a345ea --- /dev/null +++ b/reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html @@ -0,0 +1,2291 @@ + + + + + + + + Reinforcement Layers Wrapper - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • Reference »
  • +
  • Koswat docstrings »
  • +
  • Dike reinforcements »
  • +
  • Reinforcement Layers Wrapper
  • +
  • + Edit on Deltares/koswat +
  • +
+
+
+
+
+ +

Reinforcement Layers Wrapper

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+get_polygon_coordinates(pol_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Given a single or multi geometry returns the coordinates composing its outer layout.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
pol_geometry + geometry.Polygon | geometry.MultiPolygon +

Source geometry.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

When the provided geometry is not yet supported.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Set of points composing the outer layout of the geometry.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementCoatingLayer + + +

+ + +
+

+ Bases: ReinforcementLayerProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_same_outer_geometry(coating_layer: KoswatCoatingLayer) -> ReinforcementCoatingLayer + + + classmethod + + +

+ + +
+ +

Creates a new reinforcement coating layer which does not differ +in geometry from the provided coating layer. This was found to +be needed in KOSWAT_82.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
coating_layer + KoswatCoatingLayer +

Base coating layer.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + + + + + +
Name TypeDescription
ReinforcementCoatingLayer + ReinforcementCoatingLayer +

Resulting coating layer with "empty"

+ ReinforcementCoatingLayer +

polygons for added / removed (layer) geometries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+get_polygon_coordinates(pol_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Given a single or multi geometry returns the coordinates composing its outer layout.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
pol_geometry + geometry.Polygon | geometry.MultiPolygon +

Source geometry.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

When the provided geometry is not yet supported.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Set of points composing the outer layout of the geometry.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementCoatingLayer + + +

+ + +
+

+ Bases: ReinforcementLayerProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_same_outer_geometry(coating_layer: KoswatCoatingLayer) -> ReinforcementCoatingLayer + + + classmethod + + +

+ + +
+ +

Creates a new reinforcement coating layer which does not differ +in geometry from the provided coating layer. This was found to +be needed in KOSWAT_82.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
coating_layer + KoswatCoatingLayer +

Base coating layer.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + + + + + +
Name TypeDescription
ReinforcementCoatingLayer + ReinforcementCoatingLayer +

Resulting coating layer with "empty"

+ ReinforcementCoatingLayer +

polygons for added / removed (layer) geometries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> KoswatLayersWrapperProtocol + +

+ + +
+ +

Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayersWrapperProtocol + KoswatLayersWrapperProtocol +

Valid initialized instance of a KoswatLayersWrapperProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OutsideSlopeReinforcementLayersWrapperBuilder + + +

+ + +
+

+ Bases: KoswatLayersWrapperBuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementCoatingLayer + + +

+ + +
+

+ Bases: ReinforcementLayerProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_same_outer_geometry(coating_layer: KoswatCoatingLayer) -> ReinforcementCoatingLayer + + + classmethod + + +

+ + +
+ +

Creates a new reinforcement coating layer which does not differ +in geometry from the provided coating layer. This was found to +be needed in KOSWAT_82.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
coating_layer + KoswatCoatingLayer +

Base coating layer.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + + + + + +
Name TypeDescription
ReinforcementCoatingLayer + ReinforcementCoatingLayer +

Resulting coating layer with "empty"

+ ReinforcementCoatingLayer +

polygons for added / removed (layer) geometries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+get_polygon_surface_points(base_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Gets all the points composing the upper surface of a 'dike' geometry. +IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
base_geometry + Union[geometry.Polygon, geometry.MultiPolygon] +

Source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Resulting line with points from the outer geometry.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> KoswatLayersWrapperProtocol + +

+ + +
+ +

Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayersWrapperProtocol + KoswatLayersWrapperProtocol +

Valid initialized instance of a KoswatLayersWrapperProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementCoatingLayer + + +

+ + +
+

+ Bases: ReinforcementLayerProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_same_outer_geometry(coating_layer: KoswatCoatingLayer) -> ReinforcementCoatingLayer + + + classmethod + + +

+ + +
+ +

Creates a new reinforcement coating layer which does not differ +in geometry from the provided coating layer. This was found to +be needed in KOSWAT_82.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
coating_layer + KoswatCoatingLayer +

Base coating layer.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + + + + + +
Name TypeDescription
ReinforcementCoatingLayer + ReinforcementCoatingLayer +

Resulting coating layer with "empty"

+ ReinforcementCoatingLayer +

polygons for added / removed (layer) geometries.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StandardReinforcementLayersWrapperBuilder + + +

+ + +
+

+ Bases: KoswatLayersWrapperBuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+as_unified_geometry(source_geom: geometry.Polygon | geometry.MultiPolygon) -> geometry.Polygon + +

+ + +
+ +

Ensures the calculated geometry is returned as a single polygon.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
source_geom + geometry.Polygon | geometry.MultiPolygon +

Calculated source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon +

geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate).

+ +
+ +
+ + + + + + +
+ + + +

+get_normalized_polygon_difference(left_geom: geometry.Polygon, right_geom: geometry.Polygon) -> geometry.Polygon | geometry.MultiPolygon + +

+ + +
+ +

Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
left_geom + geometry.Polygon +

Base polygon from where to substract.

+ required +
right_geom + geometry.Polygon +

Polygon to substract from base.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.Polygon | geometry.MultiPolygon +

geometry.Polygon: Resulting normalized substraction polygon.

+ +
+ +
+ + + + + + +
+ + + +

+get_polygon_surface_points(base_geometry: geometry.Polygon | geometry.MultiPolygon) -> geometry.LineString + +

+ + +
+ +

Gets all the points composing the upper surface of a 'dike' geometry. +IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
base_geometry + Union[geometry.Polygon, geometry.MultiPolygon] +

Source geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ geometry.LineString +

geometry.LineString: Resulting line with points from the outer geometry.

+ +
+ +
+ + + + + + +
+ + + +

+get_relative_core_layer(core_geometry: geometry.Polygon, coating_geometry: geometry.Polygon) -> geometry.Polygon + +

+ + +
+ +

Returns a new 'core' from the original core_geometry relative to the coating_geometry.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
core_geometry + Polygon +

Original core geometry on which layers are stacked upon.

+ required +
coating_geometry + Polygon +

Layer wrapping the exterior of a core geometry.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Polygon + geometry.Polygon +

Layer wrapping a reduced surface of the core_geometry.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html b/reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html new file mode 100644 index 00000000..8e800d84 --- /dev/null +++ b/reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html @@ -0,0 +1,4102 @@ + + + + + + + + Reinforcement profile - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • Reference »
  • +
  • Koswat docstrings »
  • +
  • Dike reinforcements »
  • +
  • Reinforcement profile
  • +
  • + Edit on Deltares/koswat +
  • +
+
+
+
+
+ +

Reinforcement profile

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileCalculationProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementInputProfileProtocol + +

+ + +
+ +

Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementInputProfileProtocol + ReinforcementInputProfileProtocol +

Calculated reinforcement input profile.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileProtocol + + +

+ + +
+

+ Bases: KoswatInputProfileProtocol, Protocol

+ + +

Just an alias to distinguish from a regular KoswatInputProfileProtocol.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_domain_name: str + + + property + + +

+ + +
+ +

Returns the representative name in the "real" world of this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementProfileProtocol + +

+ + +
+ +

Builds a concrete instance of a ReinforcementProfileProtocol based on the required data.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementProfileProtocol + ReinforcementProfileProtocol +

Valid instance of a ReinforcementProfileProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileBuilderFactory + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+get_available_reinforcements() -> list[ReinforcementProfileProtocol] + + + staticmethod + + +

+ + +
+ +

Gets all available reinforcements defined in Koswat.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementProfileProtocol] +

List[ReinforcementProfileProtocol]: List of reinforcement profile protocols types.

+ +
+ +
+ + + + + + +
+ + + +

+get_reinforcement_builder(reinforcement_profile_type: type[ReinforcementProfileProtocol]) -> ReinforcementProfileBuilderProtocol + + + staticmethod + + +

+ + +
+ +

Gets a valid reinforcement profile builder instance (ReinforcementProfileBuilderProtocol).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_profile_type + Type[ReinforcementProfileProtocol] +

Type that requires a builder.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

When there is no builder associated to the given reinforcement_profile_type.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementProfileBuilderProtocol + ReinforcementProfileBuilderProtocol +

Valid instance of a ReinforcementProfileBuilderProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementProfileProtocol + +

+ + +
+ +

Builds a concrete instance of a ReinforcementProfileProtocol based on the required data.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementProfileProtocol + ReinforcementProfileProtocol +

Valid instance of a ReinforcementProfileProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StandardReinforcementProfileBuilder + + +

+ + +
+

+ Bases: ReinforcementProfileBuilderBase

+ + + + + + +
+ + + + + + + +
+ + + +

+get_input_profile_calculator(reinforcement_type: type[StandardReinforcementProfile]) -> ReinforcementInputProfileCalculationProtocol + + + staticmethod + + +

+ + +
+ +

Get the input profile calculator for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[StandardReinforcementProfile] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

The given reinforcement type is not supported.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementInputProfileCalculationProtocol + ReinforcementInputProfileCalculationProtocol +

The input profile calculator.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ BuilderProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> Any + +

+ + +
+ +

Instantiates a concrete object to separate its initalization from the data structure.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Any + Any +

Intance of a created object within Koswat domain.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileBuilderProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementProfileProtocol + +

+ + +
+ +

Builds a concrete instance of a ReinforcementProfileProtocol based on the required data.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementProfileProtocol + ReinforcementProfileProtocol +

Valid instance of a ReinforcementProfileProtocol.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementInputProfileProtocol + + +

+ + +
+

+ Bases: KoswatInputProfileProtocol, Protocol

+ + +

Just an alias to distinguish from a regular KoswatInputProfileProtocol.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_domain_name: str + + + property + + +

+ + +
+ +

Returns the representative name in the "real" world of this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileProtocol + + +

+ + +
+

+ Bases: KoswatInputProfileProtocol, Protocol

+ + +

Just an alias to distinguish from a regular KoswatInputProfileProtocol.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_domain_name: str + + + property + + +

+ + +
+ +

Returns the representative name in the "real" world of this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Outside slope

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ CofferdamInputProfileCalculation + + +

+ + +
+

+ Bases: ReinforcementInputProfileCalculationBase, ReinforcementInputProfileCalculationProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OutsideSlopeReinforcementLayersWrapperBuilder + + +

+ + +
+

+ Bases: KoswatLayersWrapperBuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileCalculationProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementInputProfileProtocol + +

+ + +
+ +

Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementInputProfileProtocol + ReinforcementInputProfileProtocol +

Calculated reinforcement input profile.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileProtocol + + +

+ + +
+

+ Bases: KoswatInputProfileProtocol, Protocol

+ + +

Just an alias to distinguish from a regular KoswatInputProfileProtocol.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_domain_name: str + + + property + + +

+ + +
+ +

Returns the representative name in the "real" world of this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + +
+ +
+ +

Standard

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatProfileBase + + + + dataclass + + +

+ + +
+

+ Bases: KoswatProfileProtocol

+ + +

Basic definition and implementation of a KoswatProfileProtocol. It represents the initial koswat profile being provided by the user from which further calculations will be made.

+ + + + + +
+ + + + + + + +
+ + + +

+points: list[Point] + + + property + + +

+ + +
+ +

The combination of points from both water and polder sides.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[Point] +

list[Point]: A total of eight points comforming the KoswatProfile.

+
+ +
+ + + + + + +
+ + + +

+profile_height: float + + + property + + +

+ + +
+ +

The profile highest point (largest y-coordinate).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Greatest y-coordinate.

+
+ +
+ + + + + + +
+ + + +

+profile_width: float + + + property + + +

+ + +
+ +

The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Total distance.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OutsideSlopeReinforcementLayersWrapperBuilder + + +

+ + +
+

+ Bases: KoswatLayersWrapperBuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PipingWallInputProfileCalculation + + +

+ + +
+

+ Bases: ReinforcementInputProfileCalculationBase, ReinforcementInputProfileCalculationProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileCalculationProtocol + + +

+ + +
+

+ Bases: BuilderProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+build() -> ReinforcementInputProfileProtocol + +

+ + +
+ +

Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementInputProfileProtocol + ReinforcementInputProfileProtocol +

Calculated reinforcement input profile.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementInputProfileProtocol + + +

+ + +
+

+ Bases: KoswatInputProfileProtocol, Protocol

+ + +

Just an alias to distinguish from a regular KoswatInputProfileProtocol.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_domain_name: str + + + property + + +

+ + +
+ +

Returns the representative name in the "real" world of this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ SoilInputProfileCalculation + + +

+ + +
+

+ Bases: ReinforcementInputProfileCalculationBase, ReinforcementInputProfileCalculationProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StabilityWallInputProfileCalculation + + +

+ + +
+

+ Bases: ReinforcementInputProfileCalculationBase, ReinforcementInputProfileCalculationProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StandardReinforcementLayersWrapperBuilder + + +

+ + +
+

+ Bases: KoswatLayersWrapperBuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StandardReinforcementProfileBuilder + + +

+ + +
+

+ Bases: ReinforcementProfileBuilderBase

+ + + + + + +
+ + + + + + + +
+ + + +

+get_input_profile_calculator(reinforcement_type: type[StandardReinforcementProfile]) -> ReinforcementInputProfileCalculationProtocol + + + staticmethod + + +

+ + +
+ +

Get the input profile calculator for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[StandardReinforcementProfile] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ NotImplementedError +

The given reinforcement type is not supported.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
ReinforcementInputProfileCalculationProtocol + ReinforcementInputProfileCalculationProtocol +

The input profile calculator.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementLayersWrapper + + +

+ + +
+

+ Bases: KoswatLayersWrapperProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+layers: list[ReinforcementLayerProtocol] + + + property + + +

+ + +
+ +

All the stored layers being the KoswatBaseLayer the latest one in the collection.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[ReinforcementLayerProtocol] +

List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/koswat_handler.html b/reference/koswat_docstrings/koswat_handler.html new file mode 100644 index 00000000..39600400 --- /dev/null +++ b/reference/koswat_docstrings/koswat_handler.html @@ -0,0 +1,608 @@ + + + + + + + + Koswat handler - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Koswat handler

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatHandler + + +

+ + +
+ + +

Handler for CLI usage of Koswat. It allows the initialization of a logger during the analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+__init__(log_output: Optional[str]) -> None + +

+ + +
+ +

Initializes the handler creating a log file at the optional provided directory log_output.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
log_output + Optional[str] +

Directory where to save the koswat.log file.

+ required +
+ +
+ +
+ + + + + + +
+ + + +

+run_analysis(analysis_file: str) -> None + +

+ + +
+ +

Runs a Koswat analysis using the provided *.ini file analysis_file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
analysis_file + str +

Location of the main koswat analysis ini file.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLogger + + +

+ + +
+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummary + + + + dataclass + + +

+ + +
+ + +

Represents the summary of the KOSWAT analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+get_infrastructure_costs() -> dict[type[ReinforcementProfileProtocol], tuple[float, float]] + +

+ + +
+ +

Gets the infrastructure costs for each profile type +for those locations for which the profile type is selected.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], tuple[float, float]] +

dict[type[ReinforcementProfileProtocol], tuple[float, float]]: +infrastructure costs without and with surtax per reinforcement type.

+ +
+ +
+ + + + + + +
+ + + +

+get_report_by_profile(profile_type: type[ReinforcementProfileProtocol]) -> MultiLocationProfileCostReport | None + +

+ + +
+ +

Get the report for a specific profile type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
profile_type + type[ReinforcementProfileProtocol] +

Type of reinforcement profile.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ MultiLocationProfileCostReport | None +

MultiLocationProfileCostReport | None: Report for the profile type.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatSummaryBuilder + + + + dataclass + + +

+ + +
+

+ Bases: BuilderProtocol

+ + + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/koswat_main.html b/reference/koswat_docstrings/koswat_main.html new file mode 100644 index 00000000..c8338537 --- /dev/null +++ b/reference/koswat_docstrings/koswat_main.html @@ -0,0 +1,430 @@ + + + + + + + + Main - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Main

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatHandler + + +

+ + +
+ + +

Handler for CLI usage of Koswat. It allows the initialization of a logger during the analysis.

+ + + + + +
+ + + + + + + +
+ + + +

+__init__(log_output: Optional[str]) -> None + +

+ + +
+ +

Initializes the handler creating a log file at the optional provided directory log_output.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
log_output + Optional[str] +

Directory where to save the koswat.log file.

+ required +
+ +
+ +
+ + + + + + +
+ + + +

+run_analysis(analysis_file: str) -> None + +

+ + +
+ +

Runs a Koswat analysis using the provided *.ini file analysis_file.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
analysis_file + str +

Location of the main koswat analysis ini file.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+run_analysis(input_file: str, log_output: str) + +

+ + +
+ +

CLI call to execute a Koswat analysis given a settings files (input_file). The log is generated by default in the execute path, unless otherwise specified in the log_output argument.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
input_file + str +

Location of the *.ini file containing the execution settings for Koswat.

+ required +
log_output + str +

Optional argument to specify where will be created the koswat.log file.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/plots/dike.html b/reference/koswat_docstrings/plots/dike.html new file mode 100644 index 00000000..89751d59 --- /dev/null +++ b/reference/koswat_docstrings/plots/dike.html @@ -0,0 +1,1275 @@ + + + + + + + + Dike plotting module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Dike plotting module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerPlot + + +

+ + +
+

+ Bases: KoswatPlotProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(color: str) -> None + +

+ + +
+ +

Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
color + str +

Color code.

+ required +
+

return list( + map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) +) + ValueError: When the KoswatLayerProtocol material has not been registered.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayerPlot + + +

+ + +
+

+ Bases: KoswatPlotProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(color: str) -> None + +

+ + +
+ +

Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
color + str +

Color code.

+ required +
+

return list( + map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) +) + ValueError: When the KoswatLayerProtocol material has not been registered.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayerProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the information related to an instance of the KoswatLayerProtocol.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

custom dictionary with the relevant data.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperPlot + + +

+ + +
+

+ Bases: KoswatPlotProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_layers_list(layers_list: List[KoswatLayerProtocol]) -> KoswatLayersWrapperPlot + + + classmethod + + +

+ + +
+ +

Class method to aid the usage of this class with unrelated layers from different wrappers.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
layers_list + List[KoswatLayerProtocol] +

List of layers to wrap just for plotting.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayersWrapperPlot + KoswatLayersWrapperPlot +

Initialized valid instance with custom intenal wrapper PlotLayersWrapper.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatLayersWrapperProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+as_data_dict() -> dict + +

+ + +
+ +

Returns the layers as a dictionary.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
dict + dict +

Dictionary containing all the information of the wrapper layers (KoswatLayerProtocol).

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+get_cmap(n_colors: int, name: int = 'hsv') + +

+ + +
+ +

Returns a function that maps each index in 0, 1, ..., n-1 to a distinct +RGB color; the keyword argument name must be a standard mpl colormap name.

+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatLayersWrapperPlot + + +

+ + +
+

+ Bases: KoswatPlotProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+with_layers_list(layers_list: List[KoswatLayerProtocol]) -> KoswatLayersWrapperPlot + + + classmethod + + +

+ + +
+ +

Class method to aid the usage of this class with unrelated layers from different wrappers.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
layers_list + List[KoswatLayerProtocol] +

List of layers to wrap just for plotting.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
KoswatLayersWrapperPlot + KoswatLayersWrapperPlot +

Initialized valid instance with custom intenal wrapper PlotLayersWrapper.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/plots/geometries.html b/reference/koswat_docstrings/plots/geometries.html new file mode 100644 index 00000000..c2b06c78 --- /dev/null +++ b/reference/koswat_docstrings/plots/geometries.html @@ -0,0 +1,393 @@ + + + + + + + + Geometries plot module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Geometries plot module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ HighlightGeometryPlot + + +

+ + +
+

+ Bases: KoswatPlotProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a layer highlighting its content.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Polygon with its area painted.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/plots/plots.html b/reference/koswat_docstrings/plots/plots.html new file mode 100644 index 00000000..3ccb17f5 --- /dev/null +++ b/reference/koswat_docstrings/plots/plots.html @@ -0,0 +1,640 @@ + + + + + + + + Plots module - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Plots module

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatFigureContextHandler + + +

+ + +
+ + +

PyPlot fig context handler that opens the figure stream and closes it saving it to the appointed path.

+ +
+ Usage example +

with KoswatFigureContext(Path("C://my_plot.png"), 42) as _figure: + _subplot = _figure.add_subplot() + ...

+
+ + + + +
+ + + + + + + +
+ + + +

+__enter__() -> Figure + +

+ + +
+ +

Access to the context and invokation of pyplot.figure(dpi).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
Figure + Figure +

Initialized instance from pyplot.figure(dpi=dpi).

+ +
+ +
+ + + + + + +
+ + + +

+__exit__(*args, **kwargs) -> None + +

+ + +
+ +

Exit the current context and save the previously initialized Figure.

+ +
+ +
+ + + + + + +
+ + + +

+__init__(output_path: Path, dpi: int) -> None + +

+ + +
+ +

Initializes the context by invoking pyplot.figure(dpi=dpi) and saving its output to an internal field.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
output_path + Path +

Export location for the generated plot.

+ required +
dpi + int +

Canvas resolution in dots-per-inch.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatPlotProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+plot(*args, **kwargs) -> pyplot.axes + +

+ + +
+ +

Plots a koswat_object into the provided plot ax with the requested *args and **kwargs.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ pyplot.axes +

pyplot.axes: Canvas with plotted koswat_object.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ KoswatExporterProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export(**kwargs) -> None + +

+ + +
+ +

Exports an object model into a concrete file format.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ PlotExporterProtocol + + +

+ + +
+

+ Bases: KoswatExporterProtocol, Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+export() -> None + +

+ + +
+ +

Exports a given object into a plot.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + +
+ + + + + + + + diff --git a/reference/koswat_docstrings/strategies.html b/reference/koswat_docstrings/strategies.html new file mode 100644 index 00000000..158a11a3 --- /dev/null +++ b/reference/koswat_docstrings/strategies.html @@ -0,0 +1,8274 @@ + + + + + + + + Strategies - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Strategies

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ StrategyInput + + + + dataclass + + +

+ + +
+ + +

Represents the input data structure for a strategy.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_min_cluster: int + + + property + + +

+ + +
+ +

Returns the minimum length of a reinforcement type +along a traject, usually named as cluster throughout +the code.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
int + int +

Total length

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationInput + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+available_measures: list[type[ReinforcementProfileProtocol]] + + + property + + +

+ + +
+ +

Gets all the available reinforcement types in strategy_location_reinforcements. +It is called available_measures to match the StrategyLocationReinforcement +definition.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[Type[ReinforcementProfileProtocol]]: resulting list.

+
+ +
+ + + + + + +
+ + + +

+cheapest_reinforcement: StrategyReinforcementTypeCosts + + + property + + +

+ + +
+ +

Gets the StrategyLocationReinforcementCosts with the lowest total_costs value.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyLocationReinforcementCosts + StrategyReinforcementTypeCosts +

The cheapest reinforcement for this location.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Get the infrastructure costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_reinforcement_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> float + +

+ + +
+ +

Get the costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The reinforcement costs.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationInput + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+available_measures: list[type[ReinforcementProfileProtocol]] + + + property + + +

+ + +
+ +

Gets all the available reinforcement types in strategy_location_reinforcements. +It is called available_measures to match the StrategyLocationReinforcement +definition.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[Type[ReinforcementProfileProtocol]]: resulting list.

+
+ +
+ + + + + + +
+ + + +

+cheapest_reinforcement: StrategyReinforcementTypeCosts + + + property + + +

+ + +
+ +

Gets the StrategyLocationReinforcementCosts with the lowest total_costs value.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyLocationReinforcementCosts + StrategyReinforcementTypeCosts +

The cheapest reinforcement for this location.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Get the infrastructure costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_reinforcement_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> float + +

+ + +
+ +

Get the costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The reinforcement costs.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyReinforcementTypeCosts + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+total_costs: float + + + property + + +

+ + +
+ +

The simple addition of the base costs and the possible +related infrastructure costs.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total costs when applying this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ PointSurroundings + + + + dataclass + + +

+ + +
+ + +

Object representing a meter with x, y coordinates in a polder (or else).

+ + + + + +
+ + + + + + + +
+ + + +

+__eq__(__value: object) -> bool + +

+ + +
+ +

Overriding of the "magic" equality operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+__hash__() -> int + +

+ + +
+ +

Overriding of the "magic" hash operator required +so that PointSurroundings can be used as a key in a python dict.

+ +
+ +
+ + + + + + +
+ + + +

+closest_obstacle: float + + + property + + +

+ + +
+ +

Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

Distance to the closest surrounding.

+
+ +
+ + + + + + +
+ + + +

+get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float] + +

+ + +
+ +

Gets the total infrastructure width at each of the provided zones +zone_limit_collection (tuple[float, float]). +The zone limits are matched by rounding up their upper limit to the +surroundings_matrix keys (distances to the location in the real world). +When two zones have overlapping limits (as expected) the lower one will +"claim" the corresponding surrounding distance.

+ +
+ Example +
    +
  • zone_limit_collection = (0, 4), (4, 11)
  • +
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • +
  • "Taken" distances per zone:
      +
    • (0, 4) takes key 5.
    • +
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
    • +
    +
  • +
  • Total infrastructure width at zones = (1.5, 9)
  • +
+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[float] +

list[float]: list with total width corresponding to each provided zone.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationInput + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+available_measures: list[type[ReinforcementProfileProtocol]] + + + property + + +

+ + +
+ +

Gets all the available reinforcement types in strategy_location_reinforcements. +It is called available_measures to match the StrategyLocationReinforcement +definition.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[Type[ReinforcementProfileProtocol]]: resulting list.

+
+ +
+ + + + + + +
+ + + +

+cheapest_reinforcement: StrategyReinforcementTypeCosts + + + property + + +

+ + +
+ +

Gets the StrategyLocationReinforcementCosts with the lowest total_costs value.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyLocationReinforcementCosts + StrategyReinforcementTypeCosts +

The cheapest reinforcement for this location.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Get the infrastructure costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_reinforcement_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> float + +

+ + +
+ +

Get the costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The reinforcement costs.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyReinforcementTypeCosts + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+total_costs: float + + + property + + +

+ + +
+ +

The simple addition of the base costs and the possible +related infrastructure costs.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total costs when applying this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyReinforcementTypeCosts + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+total_costs: float + + + property + + +

+ + +
+ +

The simple addition of the base costs and the possible +related infrastructure costs.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total costs when applying this reinforcement.

+
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ StrategyInput + + + + dataclass + + +

+ + +
+ + +

Represents the input data structure for a strategy.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_min_cluster: int + + + property + + +

+ + +
+ +

Returns the minimum length of a reinforcement type +along a traject, usually named as cluster throughout +the code.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
int + int +

Total length

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyOutput + + + + dataclass + + +

+ + +
+ + +

Represents the output data structure for a strategy.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+apply_strategy(strategy_input: StrategyInput) -> StrategyOutput + +

+ + +
+ +

Applies a specific strategy by matching each location (PointSurroundings) + to a valid reinforcement type (ReinforcementProfileProtocol).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
strategy_input + `StrategyInput` +

Input data structure containing locations and available reinforcements for each of them.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyOutput + StrategyOutput +

Output data structure containing the selected reinforcements for each location.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

Order Strategy

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ OrderStrategy + + +

+ + +
+

+ Bases: StrategyProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+get_default_order_for_reinforcements() -> list[type[ReinforcementProfileProtocol]] + + + staticmethod + + +

+ + +
+ +

Give the default order for reinforcements types, +assuming they are sorted from cheapest to most expensive +and least to most restrictive.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[type[ReinforcementProfileProtocol]]: list of reinforcement types

+ +
+ +
+ + + + + + +
+ + + +

+get_strategy_order_for_reinforcements(strategy_reinforcements: list[StrategyReinforcementInput]) -> list[type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Give the ordered reinforcement types for this strategy, from cheapest to most expensive, +possibly removing reinforcement types that are more expensive and more restrictive than others. +Cofferdam should always be the last reinforcement type.

+ +
+ Input +

strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface

+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[type[ReinforcementProfileProtocol]]: list of reinforcement types

+ +
+ +
+ + + + + + +
+ + + +

+get_strategy_reinforcements(strategy_locations: list[StrategyLocationInput], selection_order: list[type[ReinforcementProfileProtocol]]) -> list[StrategyLocationReinforcement] + + + staticmethod + + +

+ + +
+ +

Gets the strategy representation of the locations with their available measures +ordered filtered and order by the provided selection_order. It also sets +their initial state.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
strategy_locations + list[StrategyLocationInput] +

Locations to map into reinforcement locations.

+ required +
selection_order + list[type[ReinforcementProfileProtocol]] +

Priority order to assign a reinforcement.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[StrategyLocationReinforcement] +

list[StrategyLocationReinforcement]: Mapped location reinforcements.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OrderStrategyBuffering + + + + dataclass + + +

+ + +
+

+ Bases: OrderStrategyBase

+ + +

Applies buffering, through masks, to each location's pre-assigned reinforcement. +The result of the apply method will be the locations with the best +reinforcement fit (lowest index from reinforcement_order) that fulfills the +reinforcement_min_buffer requirement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OrderStrategyClustering + + + + dataclass + + +

+ + +
+

+ Bases: OrderStrategyBase

+ + +

Applies clustering, to the whole collection of reinforcements +(location_reinforcements: list[StrategyLocationReinforcement]). +The result of the apply method will be the locations with the best +reinforcement fit (lowest index from reinforcement_order) that fulfills the +reinforcement_min_length requirement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyInput + + + + dataclass + + +

+ + +
+ + +

Represents the input data structure for a strategy.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_min_cluster: int + + + property + + +

+ + +
+ +

Returns the minimum length of a reinforcement type +along a traject, usually named as cluster throughout +the code.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
int + int +

Total length

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationInput + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+available_measures: list[type[ReinforcementProfileProtocol]] + + + property + + +

+ + +
+ +

Gets all the available reinforcement types in strategy_location_reinforcements. +It is called available_measures to match the StrategyLocationReinforcement +definition.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[Type[ReinforcementProfileProtocol]]: resulting list.

+
+ +
+ + + + + + +
+ + + +

+cheapest_reinforcement: StrategyReinforcementTypeCosts + + + property + + +

+ + +
+ +

Gets the StrategyLocationReinforcementCosts with the lowest total_costs value.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyLocationReinforcementCosts + StrategyReinforcementTypeCosts +

The cheapest reinforcement for this location.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Get the infrastructure costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_reinforcement_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> float + +

+ + +
+ +

Get the costs for the given reinforcement type.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

The reinforcement type.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

The reinforcement type is not available.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The reinforcement costs.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyOutput + + + + dataclass + + +

+ + +
+ + +

Represents the output data structure for a strategy.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+apply_strategy(strategy_input: StrategyInput) -> StrategyOutput + +

+ + +
+ +

Applies a specific strategy by matching each location (PointSurroundings) + to a valid reinforcement type (ReinforcementProfileProtocol).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
strategy_input + `StrategyInput` +

Input data structure containing locations and available reinforcements for each of them.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyOutput + StrategyOutput +

Output data structure containing the selected reinforcements for each location.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ OrderStrategyBuffering + + + + dataclass + + +

+ + +
+

+ Bases: OrderStrategyBase

+ + +

Applies buffering, through masks, to each location's pre-assigned reinforcement. +The result of the apply method will be the locations with the best +reinforcement fit (lowest index from reinforcement_order) that fulfills the +reinforcement_min_buffer requirement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ OrderCluster + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+extend_cluster(other: OrderCluster) + +

+ + +
+ +

Extends the current cluster with the reinforcements +(list[StrategyLocationReinforcement]) from another cluster. +Modifies the current_selected_measure property of those measures being merged but it +does not remove them from their source cluster.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
other + OrderCluster +

Cluster whose contents will be used to extend self.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

When trying to extend from an unrelated cluster.

+ +
+ +
+ + + + + + +
+ + + +

+get_stronger_cluster() -> OrderCluster + +

+ + +
+ +

Gets the neighbor with the lowest reinforcement type value greater +than the current cluster's value (self.reinforcement_idx).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
OrderCluster + OrderCluster +

Neighbor with a stronger ReinforcementProfileProtocol.

+ +
+ +
+ + + + + + +
+ + + +

+is_compliant(min_length: float, strongest_reinforcement: int) -> bool + +

+ + +
+ +

Checks whether this OrderCluster instance is compliant within a cluster group. +This method does not check for exceptions, such as, the cluster's neighbors are +of lower strength than the current.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
min_length + float +

Minimal length a reinforcement measure is required +for a cluster.

+ required +
strongest_reinforcement + int +

What is the reinforcement index which cannot +be futher 'strengthen'.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

if the cluster is compliant within its neighbors context.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OrderStrategyClustering + + + + dataclass + + +

+ + +
+

+ Bases: OrderStrategyBase

+ + +

Applies clustering, to the whole collection of reinforcements +(location_reinforcements: list[StrategyLocationReinforcement]). +The result of the apply method will be the locations with the best +reinforcement fit (lowest index from reinforcement_order) that fulfills the +reinforcement_min_length requirement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ OrderCluster + + + + dataclass + + +

+ + +
+ + + + + + +
+ + + + + + + +
+ + + +

+extend_cluster(other: OrderCluster) + +

+ + +
+ +

Extends the current cluster with the reinforcements +(list[StrategyLocationReinforcement]) from another cluster. +Modifies the current_selected_measure property of those measures being merged but it +does not remove them from their source cluster.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
other + OrderCluster +

Cluster whose contents will be used to extend self.

+ required +
+ +

Raises:

+ + + + + + + + + + + + + +
TypeDescription
+ ValueError +

When trying to extend from an unrelated cluster.

+ +
+ +
+ + + + + + +
+ + + +

+get_stronger_cluster() -> OrderCluster + +

+ + +
+ +

Gets the neighbor with the lowest reinforcement type value greater +than the current cluster's value (self.reinforcement_idx).

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
OrderCluster + OrderCluster +

Neighbor with a stronger ReinforcementProfileProtocol.

+ +
+ +
+ + + + + + +
+ + + +

+is_compliant(min_length: float, strongest_reinforcement: int) -> bool + +

+ + +
+ +

Checks whether this OrderCluster instance is compliant within a cluster group. +This method does not check for exceptions, such as, the cluster's neighbors are +of lower strength than the current.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
min_length + float +

Minimal length a reinforcement measure is required +for a cluster.

+ required +
strongest_reinforcement + int +

What is the reinforcement index which cannot +be futher 'strengthen'.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

if the cluster is compliant within its neighbors context.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +

Infra Priority Strategy

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ InfraCluster + + + + dataclass + + +

+ + +
+ + +

This dataclass represents the subset of locations sharing the same +reinforcement type (type[ReinforcementProfileProtocol]).

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Calculates the cost of applying the reinforcement_type to +all locations present in the cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total (current) cost of this cluster.

+
+ +
+ + + + + + +
+ + + +

+fits_subclusters() -> bool + +

+ + +
+ +

Validates whether this cluster can be split into subclusters. +For that it requires to have at least twice the required length.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Whether subclusters can be generated from this one.

+ +
+ +
+ + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the length of this cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

The cluster has the minimal required length.

+ +
+ +
+ + + + + + +
+ + + +

+set_cheapest_common_available_measure(measure_costs: dict[type[ReinforcementProfileProtocol], float]) -> None + +

+ + +
+ +

Updates all the location reinforcements with the cheapest reinforcement type +from the measure_costs.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
measure_costs + dict[type[ReinforcementProfileProtocol]] +

dictionary with the total costs per reinforcement type.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfraClusterOption + + + + dataclass + + +

+ + +
+ + +

Represents one set of subclusters the strategy could select +for costs optimization.

+ + + + + +
+ + + + + + + +
+ + + +

+add_cluster(infra_cluster: InfraCluster, cluster_costs: dict) + +

+ + +
+ +

Adds the infra cluster into the collection as well as its reinforcement +costs.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
infra_cluster + InfraCluster +

Cluster to add to this collection option.

+ required +
cluster_costs + dict +

Reinforcement costs for the given cluster.

+ required +
+ +
+ +
+ + + + + + +
+ + + +

+cluster_collection: list[InfraCluster] + + + property + + +

+ + +
+ +

Read-only property to expose the stored subclusters.

+
+ +
+ + + + + + +
+ + + +

+cluster_costs: list[dict[ReinforcementProfileProtocol, float]] + + + property + + +

+ + +
+ +

Read-only property to expose the stored costs.

+
+ +
+ + + + + + +
+ + + +

+set_cheapest_option() + +

+ + +
+ +

Sets the subclusters defined in this option to their most optimal (cheapest) +reinforcement possible.

+ +
+ +
+ + + + + + +
+ + + +

+valid_option() -> bool + +

+ + +
+ +

Validates the collection of clusters based on the +required minimun length.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Validation result.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfraPriorityStrategy + + +

+ + +
+

+ Bases: StrategyProtocol

+ + +

This strategy works under the assumption that +StrategyLocationReinforcement.available_measures +ARE NOT ordered by "compatibility". +Thus we need to check first which are the compatible reinforcements +per cluster.

+ + + + + +
+ + + + + + + +
+ + + +

+generate_subcluster_options(from_cluster: InfraCluster, min_length: int) -> list[list[InfraCluster]] + + + staticmethod + + +

+ + +
+ +

Generates all possible combinations of (sub) clusters based on the locations +of this cluster. These are also referred as "options".

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
min_length + int +

Minimum length for a cluster to be valid.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[list[InfraCluster]] +

list[list[InfraCluster]]: Collection of "options" with valid length.

+ +
+ +
+ + + + + + +
+ + + +

+get_common_available_measures_costs(infra_cluster: InfraCluster, order_strategy_reinforcements: list[type[ReinforcementProfileProtocol]]) -> dict[type[ReinforcementProfileProtocol], float] + + + staticmethod + + +

+ + +
+ +

Gets a dictionary with the reinforcements available at all +locations of the cluster (infra_cluster) as well as their +total cost if said reinforcement is applied at them.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
infra_cluster + InfraCluster +

Cluster being analyzed.

+ required +
order_strategy_reinforcements + list[type[ReinforcementProfileProtocol]] +

Reinforcements ordered by base cost (ground surface).

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ dict[type[ReinforcementProfileProtocol], float] +

dict[type[ReinforcementProfileProtocol], float]: +Resulting reinforcement type - costs dictionary.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ OrderStrategy + + +

+ + +
+

+ Bases: StrategyProtocol

+ + + + + + +
+ + + + + + + +
+ + + +

+get_default_order_for_reinforcements() -> list[type[ReinforcementProfileProtocol]] + + + staticmethod + + +

+ + +
+ +

Give the default order for reinforcements types, +assuming they are sorted from cheapest to most expensive +and least to most restrictive.

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[type[ReinforcementProfileProtocol]]: list of reinforcement types

+ +
+ +
+ + + + + + +
+ + + +

+get_strategy_order_for_reinforcements(strategy_reinforcements: list[StrategyReinforcementInput]) -> list[type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Give the ordered reinforcement types for this strategy, from cheapest to most expensive, +possibly removing reinforcement types that are more expensive and more restrictive than others. +Cofferdam should always be the last reinforcement type.

+ +
+ Input +

strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface

+
+

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[type[ReinforcementProfileProtocol]] +

list[type[ReinforcementProfileProtocol]]: list of reinforcement types

+ +
+ +
+ + + + + + +
+ + + +

+get_strategy_reinforcements(strategy_locations: list[StrategyLocationInput], selection_order: list[type[ReinforcementProfileProtocol]]) -> list[StrategyLocationReinforcement] + + + staticmethod + + +

+ + +
+ +

Gets the strategy representation of the locations with their available measures +ordered filtered and order by the provided selection_order. It also sets +their initial state.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
strategy_locations + list[StrategyLocationInput] +

Locations to map into reinforcement locations.

+ required +
selection_order + list[type[ReinforcementProfileProtocol]] +

Priority order to assign a reinforcement.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ list[StrategyLocationReinforcement] +

list[StrategyLocationReinforcement]: Mapped location reinforcements.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyInput + + + + dataclass + + +

+ + +
+ + +

Represents the input data structure for a strategy.

+ + + + + +
+ + + + + + + +
+ + + +

+reinforcement_min_cluster: int + + + property + + +

+ + +
+ +

Returns the minimum length of a reinforcement type +along a traject, usually named as cluster throughout +the code.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
int + int +

Total length

+
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyOutput + + + + dataclass + + +

+ + +
+ + +

Represents the output data structure for a strategy.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyProtocol + + +

+ + +
+

+ Bases: Protocol

+ + + + + + +
+ + + + + + + +
+ + + +

+apply_strategy(strategy_input: StrategyInput) -> StrategyOutput + +

+ + +
+ +

Applies a specific strategy by matching each location (PointSurroundings) + to a valid reinforcement type (ReinforcementProfileProtocol).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
strategy_input + `StrategyInput` +

Input data structure containing locations and available reinforcements for each of them.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
StrategyOutput + StrategyOutput +

Output data structure containing the selected reinforcements for each location.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ InfraCluster + + + + dataclass + + +

+ + +
+ + +

This dataclass represents the subset of locations sharing the same +reinforcement type (type[ReinforcementProfileProtocol]).

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Calculates the cost of applying the reinforcement_type to +all locations present in the cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total (current) cost of this cluster.

+
+ +
+ + + + + + +
+ + + +

+fits_subclusters() -> bool + +

+ + +
+ +

Validates whether this cluster can be split into subclusters. +For that it requires to have at least twice the required length.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Whether subclusters can be generated from this one.

+ +
+ +
+ + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the length of this cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

The cluster has the minimal required length.

+ +
+ +
+ + + + + + +
+ + + +

+set_cheapest_common_available_measure(measure_costs: dict[type[ReinforcementProfileProtocol], float]) -> None + +

+ + +
+ +

Updates all the location reinforcements with the cheapest reinforcement type +from the measure_costs.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
measure_costs + dict[type[ReinforcementProfileProtocol]] +

dictionary with the total costs per reinforcement type.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ StrategyLocationReinforcement + + + + dataclass + + +

+ + +
+ + +

Represents a location and the different reinforcements that can be applied to it +as well their costs. +This class is used to show the final chosen state for a location.

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Estimates the costs at this location for the given current_selected_measure.

+
+ +
+ + + + + + +
+ + + +

+current_selected_measure: type[ReinforcementProfileProtocol] + + + property + + +

+ + +
+ +

Exposes the current selected measure for this object.

+
+ +
+ + + + + + +
+ + + +

+get_infrastructure_costs(reinforcement_type: type[ReinforcementProfileProtocol]) -> tuple[float, float] + +

+ + +
+ +

Returns the infrastructure costs for the given reinforcement type (without and with surtax).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type.

+ required +
+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[float, float] +

tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.

+ +
+ +
+ + + + + + +
+ + + +

+get_selected_measure_steps() -> tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] + +

+ + +
+ +

Outputs the selected measure following the domain (expected) steps: + - Initial step, + - Order step, + - Infrastructure step

+ +

Returns:

+ + + + + + + + + + + + + +
TypeDescription
+ tuple[type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]] +

tuple[ +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol], +type[ReinforcementProfileProtocol]]: Resulting tuple.

+ +
+ +
+ + + + + + +
+ + + +

+set_selected_measure(reinforcement_type: type[ReinforcementProfileProtocol], step: StrategyStepEnum) + +

+ + +
+ +

Changes the value reprsented in current_selected_measure and updates the +dictionary of selections (history).

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
reinforcement_type + type[ReinforcementProfileProtocol] +

Reinforcement type

+ required +
step + StrategyStepsEnum +

Step whose

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ InfraCluster + + + + dataclass + + +

+ + +
+ + +

This dataclass represents the subset of locations sharing the same +reinforcement type (type[ReinforcementProfileProtocol]).

+ + + + + +
+ + + + + + + +
+ + + +

+current_cost: float + + + property + + +

+ + +
+ +

Calculates the cost of applying the reinforcement_type to +all locations present in the cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
float + float +

The total (current) cost of this cluster.

+
+ +
+ + + + + + +
+ + + +

+fits_subclusters() -> bool + +

+ + +
+ +

Validates whether this cluster can be split into subclusters. +For that it requires to have at least twice the required length.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Whether subclusters can be generated from this one.

+ +
+ +
+ + + + + + +
+ + + +

+is_valid() -> bool + +

+ + +
+ +

Validates the length of this cluster.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

The cluster has the minimal required length.

+ +
+ +
+ + + + + + +
+ + + +

+set_cheapest_common_available_measure(measure_costs: dict[type[ReinforcementProfileProtocol], float]) -> None + +

+ + +
+ +

Updates all the location reinforcements with the cheapest reinforcement type +from the measure_costs.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
measure_costs + dict[type[ReinforcementProfileProtocol]] +

dictionary with the total costs per reinforcement type.

+ required +
+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ InfraClusterOption + + + + dataclass + + +

+ + +
+ + +

Represents one set of subclusters the strategy could select +for costs optimization.

+ + + + + +
+ + + + + + + +
+ + + +

+add_cluster(infra_cluster: InfraCluster, cluster_costs: dict) + +

+ + +
+ +

Adds the infra cluster into the collection as well as its reinforcement +costs.

+ +

Parameters:

+ + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescriptionDefault
infra_cluster + InfraCluster +

Cluster to add to this collection option.

+ required +
cluster_costs + dict +

Reinforcement costs for the given cluster.

+ required +
+ +
+ +
+ + + + + + +
+ + + +

+cluster_collection: list[InfraCluster] + + + property + + +

+ + +
+ +

Read-only property to expose the stored subclusters.

+
+ +
+ + + + + + +
+ + + +

+cluster_costs: list[dict[ReinforcementProfileProtocol, float]] + + + property + + +

+ + +
+ +

Read-only property to expose the stored costs.

+
+ +
+ + + + + + +
+ + + +

+set_cheapest_option() + +

+ + +
+ +

Sets the subclusters defined in this option to their most optimal (cheapest) +reinforcement possible.

+ +
+ +
+ + + + + + +
+ + + +

+valid_option() -> bool + +

+ + +
+ +

Validates the collection of clusters based on the +required minimun length.

+ +

Returns:

+ + + + + + + + + + + + + +
Name TypeDescription
bool + bool +

Validation result.

+ +
+ +
+ + + + +
+ +
+ +
+ + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +

Strategy step

+ + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +

+ ReinforcementProfileProtocol + + +

+ + +
+

+ Bases: KoswatProfileProtocol, Protocol

+ + +

Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.

+ + + + + +
+ + + + + +
+ +
+ +
+ + + + +
+ +
+ +
+ +
+ + + +
+ + + +
+ + + + + +
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_main_workflow.html b/reference/koswat_main_workflow.html new file mode 100644 index 00000000..2a0e4d47 --- /dev/null +++ b/reference/koswat_main_workflow.html @@ -0,0 +1,270 @@ + + + + + + + + Main workflow - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Main workflow

+

As described in the user manual, the tool can be used either as a sandbox, where the user has responsibility on how to put together an analysis, or as a command line tool.

+

When using the latter unfortunately we will only have one available call, in this chapter we will breakdown this main workflow so that we can better understand the structure of the rest of the package.

+

First of all, let's write the workflow as a pipeline:

+
CLI call 
+-> Import of ini files 
+-> Run scenarios 
+    -> Generate reinforcement profiles 
+    -> Calculate reinforcement costs 
+        -> Apply measure selection strategy 
+        -> Calculate total costs
+    -> Export results
+
+ + + + + + + + + + + +
General Workflow
Image 1. General Workflow
+

CLI Call

+

This step is very straightforward, the command line will run the method run_analysis, which will initiate the KoswatHandler and start an analysis.

+

Import of ini files

+

This step comprehends of several more steps. Usually, for each of the file imports an internal workflow will happen:

+

File -> Import -> File Object Model -> Build -> Data Object Model

+

This step is summarized by the generation of the KoswatRunSettings object.

+

Run scenarios

+

Each KoswatRunScenarioSettings will run a koswat analysis for a given dike section. +To do so, a specific KoswatProfileBase will be created based on the conditions from the KoswatScenario and the surroundings of said dike section.

+

Generate reinforcement profiles

+

All reinforcement profiles will be calculated for the scenario KoswatProfileBase profile.

+

Calculate reinforcement costs

+

For this step, we will be creating a cost report +For each of the reinforcement profiles we will calculate their associated costs if they were to be applied at all the available traject points where the surroundings allow it.

+

Apply measure selection strategy

+

Based on the available locations and the reinforcements that can be applied to it, a selection strategy finds which construction should be done at each location based on the strategy's criteria.

+

Calculate total costs

+

Once Koswat knows which measure will be applied to each location, and with the previously calculated reinforcement costs, it will estimate the total meters required of each reinforcement and their total cost in euros (€).

+

Export results

+

Once the costs reports are generate each of the summaries is exported to a *.csv file whilst the reinforcement profiles 'layers' are also exported into different *.png files.

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_reinforced_profile.html b/reference/koswat_reinforced_profile.html new file mode 100644 index 00000000..9befbbaa --- /dev/null +++ b/reference/koswat_reinforced_profile.html @@ -0,0 +1,231 @@ + + + + + + + + Reinforcement profile - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Reinforcement profile

+

In koswat we consider a reinforcement profile the result of applying one of the multiple possible reinforcement calculations on an instance of a KoswatProfileBase (Koswat dike).

+

This chapter covers the description of a reinforcement profile and its parts.

+

Properties

+

A reinforcement profile implements the ReinforcementProfileProtocol, which is a specialization of the KoswatProfileProtocol with some differences:

+
    +
  • input_data: Similar to the base profile input_data but instead implements the ReinforcementInputProfileProtocol, a specialization of the (KoswatInputProfileProtocol) which depends on the type of reinforcement being applied.
  • +
  • old_profile: New property which contains the koswat profile from which the calculation was based on.
  • +
+

Possible reinforcements.

+

We have two main different sort of reinfocements which contain also subtypes for said reinforcements:

+
    +
  • Outside slope reinforcement: Cofferdam (kistdam), based on the OutsideSlopeReinforcementProfile. With this reinforcement the outside slope (buiten talud) of the dike is impacted.
  • +
  • Standard reinforcement: Piping wall (kwelscherm), soil (grondmaatregel profiel), stability wall (stabiliteitswand), vertical piping solution (verticale piping oplossing). The previous being based on the StandardReinforcementProfile.
  • +
  • A piping wall can be implemented by a cb wall (cement-bentoniet wand) and an unanchored sheet pile (onverankerde damwand).
  • +
  • A stability wall can be implemented by a diaphragm wall (diepwand) and an anchored sheet pile (verankerde damwand).
  • +
+

In addition, the above mentioned reinforcements can also implement their own ReinforcementInputProfileProtocol, which are after all extensions of the KoswatInputProfileBase with extra properties.

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_strategies.html b/reference/koswat_strategies.html new file mode 100644 index 00000000..ef7b2fda --- /dev/null +++ b/reference/koswat_strategies.html @@ -0,0 +1,994 @@ + + + + + + + + Strategies - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Strategies

+

Koswat can determine which is the "best" reinforcement type for a dike traject based on different selection criteria that we name "strategies" (StrategyProtocol).

+

A strategy requires a strategy input (StrategyInput), this input contains information over which reinforcement types are available at each location as well as what's the minimal buffer (reinforcement_min_buffer) and minimal length (reinforcement_min_length) for each reinforcement type.

+

By default a strategy is applied as follows:

+
    +
  1. For each point (meter) in the traject, determine which reinforcements can be applied to it.
  2. +
  3. Choose one of the available reinforcements based on the chosen strategy. When no reinforcement is available the most restrictive will be chosen (CofferDam).
  4. +
  5. Apply a buffer (reinforcement_min_buffer) for each one of the reinforcements.
  6. +
  7. Check if the minimal distance between constructions is met (reinforcement_min_length), otherwise change it into one of the reinforcements next to it.
  8. +
  9. Repeat 4 until all reinforcements have enough distance between themselves.
  10. +
  11. Find based on the strategy for infrastructure derived costs, mapped locations (list[StrategyLocationReinforcement]) whose reinforcement can be increased into a most restrictive one with total lower costs.
  12. +
  13. Return list of mapped locations (list[StrategyLocationReinforcement]).
  14. +
+

Available strategies

+

Currently the following strategies are implemented:

+ +

Order based

+

This strategy is the first and default of all defined strategies. Its criteria is based on a pre-defined 'order' of each reinforcement. In steps, it can be seen as:

+
    +
  1. Pre-selection of a location's available reinforcement based on said order, when a location does not have any "available" reinforcement, then the last reinforcement's order will be pre-selected.
  2. +
  3. Grouping of all locations by their pre-selected reinforcement.
  4. +
  5. Buffering to each of the groupings.
  6. +
  7. Clustering to the resulting groupings from the previous step.
  8. +
+

Reinforcement order

+

The reinforcements are ordered based on increasing cost (including surtax) and decreasing width. +Reinforcements that are more expensive but are wider or have equal width are skipped (order -1). +The CofferDamReinforcementProfile will never be skipped and is always the last reinforcement that is applied in case no other reinforcement fits the surroundings.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Reinforcement typeProfile widthCost with surtaxIndex
SoilReinforcementProfile101000
VPSReinforcementProfile20200-1
PipingWallReinforcementProfile10300-1
StabilityWallReinforcementProfile54001
CofferDamReinforcementProfile05002
+

Reinforcement grouping

+

We create reinforcement-location "grouping" for the whole traject.

+

A grouping represents a reinforcement type that is "selected" for a series of continuous locations. This means locations that are next to each other sharing the same measure type (Type[ReinforcementProfileProtocol]).

+
Grouping example
+

Simplified representation for a traject with 10 locations. This example is also tested in the tests.strategies.order_strategy.py test file. +

{
+    "SoilReinforcementProfile": [
+        "Location_000",
+        "Location_001",
+        "Location_002",
+    ],
+    "StabilityWallReinforcementProfile": [
+        "Location_003",
+        "Location_004",
+    ],
+    "SoilReinforcementProfile": [
+        "Location_005",
+        "Location_006",
+        "Location_007",
+    ],
+    "CofferDamReinforcementProfile": [
+        "Location_008",
+        "Location_009",
+    ],
+}
+

+

Reinforcement buffering

+

Given a reinforcement grouping, we will create a dictionary of masks of size NM where N (the keys) is the number of available reinforcement types (Type[ReinforcementProfileProtocol]) and M the number of available locations.

+

Note: Masks' values are the position of a reinforcement type in the reinforcement's order list. So a location withCofferDamReinforcementProfile will have a 4 at the mask's position, whilst a SoilReinforcementProfile will have a 0 instead (remember in Python indexing starts with 0).

+

Steps breakdown:

+
    +
  1. +

    Initialize the dictionary masks with all values to -1.

    +
  2. +
  3. +

    Iterate over the groupings list, and for each entry:

    +
      +
    1. +

      Select the mask to update using the grouping's reinforcement type (cluster's key).

      +
    2. +
    3. +

      Update the indices representing the grouping's locations (grouping's values) with the matching value for this grouping's key (see previous note).

      +
    4. +
    5. +

      Add a buffer (StrategyInput.reinforcement_min_buffer) by updating the adjacent's positions of this grouping with the same values as in step 1.

      +
    6. +
    +
  4. +
  5. +

    Merge all masks into a 1-dimensional array where the cell's value is the maximum between the available masks.

    +
      +
    • This is done to prevent that a buffer of a "stronger" demanding reinforcement such as CofferDamReinforcementProfile is replaced by a "weaker" one.
    • +
    +
  6. +
  7. +

    Update the locations with their new associated reinforcement. The resulting mask contains the index of the reinforcement to be applied in the reinforcement's order.

    +
  8. +
+
Buffering example
+

One simplified example, based on the grouping example, and using a buffer value of "1". This example is also tested in the tests.strategies.order_strategy_buffering.py test file.

+
1. Initialize the masks based on the provided clusters:
+    {
+        "SoilReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1 ,-1, -1, -1, -1],
+        "VPSReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1 ,-1, -1, -1, -1],
+        "PipingWallReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1 ,-1, -1, -1, -1],
+        "StabilityWallReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1 ,-1, -1, -1, -1],
+        "CofferDamReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1 ,-1, -1, -1, -1],
+    }
+
+2. Iterate over the clusters and update the masks' values:
+    {
+        "SoilReinforcementProfile": 
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0, -1],
+        "VPSReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
+        "PipingWallReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1],
+        "StabilityWallReinforcementProfile": 
+            [-1, -1,  3,  3,  3,  3, -1, -1, -1, -1],
+        "CofferDamReinforcementProfile": 
+            [-1, -1, -1, -1, -1, -1, -1,  4,  4,  4],
+    }
+
+3. Merge all masks and select their maximum value:
+    [0, 0, 3, 3, 3, 3, 0, 4, 4, 4]
+
+4. Update the cluster's locations:
+    {
+        "SoilReinforcementProfile": [
+            "Location_000",
+            "Location_001",
+        ],
+        "StabilityWallReinforcementProfile": [
+            "Location_002",
+            "Location_003",
+            "Location_004",
+            "Location_005",
+        ],
+        "SoilReinforcementProfile": [
+            "Location_006",
+        ],
+        "CofferDamReinforcementProfile": [
+            "Location_007",
+            "Location_008",
+            "Location_009",
+        ],
+    }
+
+

Reinforcement clustering

+

Given a reinforcement grouping, ideally done after applying buffering, we will now proceed to change the pre-selected reinforcement of all those groupings that contain less locations than required by the describing property. We do this by updating their type with the one of a "stronger" adjacent grouping, on this section called "clusters". These clusters are internally represented by the class OrderCluster.

+

The strategy here is to detect non-compliant reinforcement-location clusters and replace their selected reinforcement type with the "least strong" of its adjacent clusters. We do this iteratively, so we first target the lowest type of reinforcements (SoilReinforcementProfile) and we move up until the first to the last (the last one cannot be further strengthened).

+

Conditions:

+
    +
  • We define a non-compliant cluster as a cluster that does not contain as many locations as defined by the minimal length requirement (reinforcement_min_length).
  • +
  • We also define a non-compliant exception when a cluster does not meet said requirement but the adjacent clusters are of a lower reinforcement type. Therefore retaining their initial reinforcement type.
  • +
  • The first and last clusters, are always considered compliant. Therefore they retain their initial reinforcement type.
  • +
  • Clusters whose reinforcement type is placed the last in the strategy's order, are skipped and always considered compliant, as they cannot be further strengthened.
  • +
+

Steps breakdown:

+
    +
  1. Generate a list of all available unmerged clusters.
  2. +
  3. For each reinforcement type target-reinforcement, in the strategy order:
      +
    1. Get the current non-compliant clusters
    2. +
    3. For each non-compliant target-reinforcement cluster :
        +
      1. Check if its indeed not compliant.
          +
        • Otherwise move to the next cluster.
        • +
        +
      2. +
      3. Get a stronger cluster among the neighbors. Selects the neighbor with the +"weakest", yet greater than the actual, reinforcement type value.
          +
        • If both neighbors are "weaker" than the current reinforcement type, +then it is considered an "exception" as it cannot be further strengthened. +We therefore move to the next non-compliant cluster.
        • +
        +
      4. +
      5. Move the current cluster's locations to the stronger reinforcement cluster.
      6. +
      7. Remove the cluster from the "available clusters" list as it is integrated in +step 2.2.3.
      8. +
      +
    4. +
    +
  4. +
+
Clustering example
+

One simplified example, based on the buffering example, and using a minimal distance of "5". This example is also tested in the tests.strategies.order_strategy_clustering.py test file.

+
1. List of unmerged clusters:
+    {
+        (0, ["Location_000","Location_001",]),
+        (3, ["Location_002","Location_003","Location_004","Location_005",]),
+        (0, ["Location_006",]),
+        (4, ["Location_007","Location_008","Location_009",])
+    }
+
+2. Iterate over each reinforcement type:
+
+2.1. Target is "SoilReinforcementProfile" (idx=0), non-compliant clusters
+    {
+        (0, ["Location_006",])
+    }
+
+2.1.1. Length = 1.
+
+2.1.2. Get a stronger neighbor,
+    - Left-neighbor reinforcement type = 3,
+    - Right-neighbor reinforcement type = 4,
+    - Left-neighbor is selected.
+
+2.1.3. Move locations to stronger neighbor.
+    {
+        (2, ["Location_002", ... ,"Location_006",]),
+        (0, ["Location_006",]),
+    }
+
+2.1.4. Remove the current cluster from the available list.
+
+2.2. Target is "PipingWallReinforcementProfile" (idx=2), 
+    - All clusters are compliant at this point.
+
+2.3. Target is "StabilityWallReinforcementProfile" (idx=3),
+    - All clusters are compliant at this point.
+
+2.4. "CofferDamReinforcementProfile" (idx=4)
+    - Last reinforcement profile type, therefore the strongest.
+
+Resulting cluster:
+    {
+        (0, ["Location_000","Location_001",]),
+        (3, ["Location_002","Location_003","Location_004","Location_005","Location_006",]),
+        (4, ["Location_007","Location_008","Location_009",]),
+    }
+
+

Infrastructure priority

+

DEFAULT STRATEGY +This strategy checks whether the clusters resulting from the order based strategy can change their selected reinforcement to one with cheaper costs. These costs are extracted from the cost report and relate to the reinforcement profile costs (dike's materials for the required space) and the possible infrastructure costs. In steps, this strategy can be broke down as:

+

Steps breakdown:

+
    +
  1. Assignment of order based clusters,
  2. +
  3. Cluster options evaluation,
      +
    1. Common available measures cost calculation,
    2. +
    3. Cheapest option selection,
    4. +
    +
  4. +
  5. Update reinforcement selection with selected option.
  6. +
+

Cluster options

+

For an optimal assignment of a new reinforcement profile, we make use of "subclusters". These subclusters are contiguous subsets from an order based cluster and have the minimal required length (StrategyInput.reinforcement_min_cluster). The logic for this section can be found in InfraPriorityStrategy.generate_subcluster_options.

+

For each of original the clusters, multiple combinations of subclusters are possible. We refer to them as "cluster option" (InfraClusterOption) . We can already discard creating subclusters when the size of the original cluster is less than twice the required minimal length. So for a minimal length of 2 locations, you require a cluster of at least 4 locations to generate subclusters.

+

Conditions:

+
    +
  • We only create subclusters when the cluster's original size is, at least, twice the required minimal cluster's length.
  • +
  • We estimate the cluster's minimal length to be at least twice the size of the buffer so: min_cluster_length = (2 * reinforcement_min_buffer) + 1.
  • +
  • We create subclusters based on the immediate results of the order based strategy. We do not try to combine or create new clusters based on a "greedier" strategy.
  • +
+
Cluster option example
+

For example, given the results of the clustering example we can calculate the options for the clusters for a required minimal length of 2:

+
    +
  1. List of clusters: +
    {
    +    (0, ["Location_000","Location_001",]),
    +    (3, ["Location_002","Location_003",
    +            "Location_004","Location_005",
    +            "Location_006",]),
    +    (4, ["Location_007","Location_008","Location_009",]),
    +}
    +
  2. +
  3. +

    Options for cluster {(0, ["Location_000","Location_001",])} +

    - Valid options:
    +    (0, ["Location_000","Location_001",])
    +

    +
  4. +
  5. +

    Options for cluster {(3, ["Location_002","Location_003", "Location_004","Location_005", "Location_006",])} +

    - Valid:
    +    - {["Location_002", "Location_003"],
    +        ["Location_004", "Location_005", "Location_006"]},
    +    - {["Location_002", "Location_003", "Location_004"],
    +        ["Location_005", "Location_006"]}
    +- Invalid:
    +    - first subcluster's size is less than required:
    +        {["Location_002"],
    +        ["Location_003", "Location_004"],
    +        ["Location_005", "Location_006"]}
    +
    +    - last subcluster's size is less than required:
    +        {["Location_002", "Location_003"],
    +        ["Location_004", "Location_005"],
    +        ["Location_006"]}, 
    +    - second subcluster's size is less than required:
    +        {["Location_002", "Location_003"],
    +        ["Location_004"],
    +        ["Location_005", "Location_006"]}, 
    +    - and so on...
    +

    +
  6. +
  7. +

    Options for cluster {(4, ["Location_007","Location_008","Location_009",]),} +

    - Valid:
    +    - {["Location_007","Location_008","Location_009",]}
    +- Invalid:
    +    - first subcluster's size is less than required:
    +        {["Location_007"], ["Location_008", "Location_009"]}
    +    - last subcluster's size is less than required:
    +        {["Location_007", "Location_008"], ["Location_009"]}
    +    - and so on...
    +

    +
  8. +
+

Cluster common available measures' cost

+

Once we have calculated a cluster's option we can determine whether this cluster should be consider as a valid one. This estimation is based on the cheapest reinforcement's cost, and to get this value we first need to know which reinforcements are available at all the locations of this option.

+

We will store this value in the InfraClusterOption.cluster_costs. In the current implementation, these costs are added to the InfraClusterOption together with the cluster's data (list[InfraCluster]).

+

Conditions:

+
    +
  • A "viable" cluster option must be cheaper than the order's cluster and has the cluster's minimal length.
  • +
  • We consider "minimal costs" or "lower costs" as the lowest cost of applying a certain reinforcement type to a given subcluster.
  • +
+
Common available measures' cost example
+

Following the options example we can estimate some fictional costs based on the following tables (if a type / location is not mentioned, then assume its cost is zero (0)):

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IndexReinforcement typebase cost
0Soil reinforcement42
1Vertical Piping Solution420
2Piping Wall4.200
3Stability Wall42.000
4Cofferdam420.000
+ + + + + + + + + + + + + + + + + + + + +
LocationReinforcement indicesInfrastructure cost
Location_0000, 14.200.000
Location_0050, 1, 2, 34.200.000
+

We already know that only the second cluster can generate subclusters, therefore different valid options, so we will use said subcluster's options for the example.

+
1. Determine current cost:
+    - {3, ["Location_002", "Location_003",
+        "Location_004", "Location_005", "Location_006"]}
+    - Base costs = 5 * 42.000 = 210.000
+    - Infra costs = (1) * 4.200.000 = 4.200.000
+    - Total costs = 4.410.000
+
+2. Calculate costs for first option:
+    - {(3, ["Location_002", "Location_003"],
+        ["Location_004", "Location_005", "Location_006"])},
+    1. First subcluster's common measures:
+        - Stability Wall (current):
+            - Base costs = 2 * 42.000 = 84.000
+            - Infra costs = 0
+            - Total costs = 42.000
+        - Cofferdam:
+            - Base costs = 2 * 420.000 = 840.000
+            - Infra costs = 0
+            - Total costs = 840.000
+        - The current reinfocement is cheaper
+    2. Second subcluster's common measures:
+        - Stability Wall (current):
+            - Base costs = 3 * 42.000 = 126.000
+            - Infra costs = (1) * 4.200.000 = 4.200.000
+            - Total costs = 4.326.000
+        - Cofferdam:
+            - Base costs = 3 * 420.000 = 1.260.000
+            - Infra costs = 0
+            - Total costs = 1.260.000
+        - Cofferdam will be cheaper.
+    3. Subcluster's best option is cheaper than current:
+        - {(3, ["Location_002", "Location_003"]),
+        (4, ["Location_004", "Location_005", "Location_006"])}
+        - Total cost = 42.000 + 1.260.000 = 1.302.000
+        - Selected as option.
+
+3. Calculate costs for second option:
+    - {3, (["Location_002", "Location_003", "Location_004"],
+        ["Location_005", "Location_006"])}
+    1. First subluster's common measures
+        - Stability Wall (current):
+            - Base costs = 3 * 42.000 = 126.000
+            - Infra costs = 0
+            - Total costs = 126.000
+        - Cofferdam:
+            - Base costs = 3 * 420.000 = 1.260.000
+            - Infra costs = 0
+            - Total costs = 1.260.000
+        - The current reinfocement is cheaper
+    2. Second subluster's common measures
+        - Stability Wall (current):
+            - Base costs = 2 * 42.000 = 84.000
+            - Infra costs = 0
+            - Total costs = 84.000
+        - Cofferdam:
+            - Base costs = 2 * 420.000 = 840.000
+            - Infra costs = 0
+            - Total costs = 840.000
+        - Cofferdam is cheaper
+    3. Subcluster's best option is cheaper than selection:
+        - {(3, ["Location_002", "Location_003", "Location_004"]),
+            (4, ["Location_005", "Location_006"])}
+        - Total cost = 126.000 + 840.000 = 966.000
+        - Selected as option.
+
+4. Update locations' selected reinforcement:
+{
+    (2, ["Location_000","Location_001",]),
+    (3, ["Location_002","Location_003", "Location_004",]),
+    (4, ["Location_005","Location_006", "Location_007",
+          "Location_008","Location_009",]),
+}
+
+

In this example we can therefore demonstrate the cost reduction. The last column represents the difference (positive means saved money):

+
    +
  • O.S. = Order strategy
  • +
  • I.S. = Infrastructure priority strategy
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Location(O.S.) reinforcement(O.S.) cost(I.S.) reinforcement(I.S.) costDifference
Total----6.090.084----2.226.840+3.863.244
Location_000Soil reinforcement4.200.042Piping Wall420+4.199.622
Location_001Soil reinforcement42Piping Wall420-378
Location_002Stability Wall42.000Stability Wall42.0000
Location_003Stability Wall42.000Stability Wall42.0000
Location_004Stability Wall42.000Stability Wall42.0000
Location_005Stability Wall462.000Cofferdam420.000+42000
Location_006Stability Wall42.000Cofferdam420.000-378000
Location_007Cofferdam420.000Cofferdam420.0000
Location_008Cofferdam420.000Cofferdam420.0000
Location_009Cofferdam420.000Cofferdam420.0000
+

Infrastructure priority (old approach) example

+
+
+

Important! +This example is based on the first approach of this strategy and its steps might differ from the current solution. We left this example as it can help understanding the basic concepts of the strategy.

+
+
+

We will start by defining some unrealistic costs per reinforcement type for all locations* such as. For a more realistic scenario check the subclustering example:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IndexReinforcement typebase costinfra costtotal cost
0Soil reinforcement42420.000420.042
1Vertical Piping Solution420420.000420.420
2Piping Wall420004200
3Stability Wall42.000420.000462.000
4Cofferdam420.0000420.000
+
+
+

Important! +For example purposes we are applying the same infrastructure costs to all the locations. |However, in a real case these costs would vary per location (and per reinforcement type). So we can determine the cluster's reinforcement costs as (total cost) * N locations

+
+
+

Based on this data Piping Wall will be chosen unless any of the points in the cluster cannot apply it due to obstacles or other constraints, in which case it would end up settling for a Cofferdam reinforcement.

+

Let's see now the strategy steps using the results from the clustering example:

+
1. List of clusters:
+    {
+        (0, ["Location_000","Location_001",]),
+        (3, ["Location_002","Location_003",
+                "Location_004","Location_005",
+                "Location_006",]),
+        (4, ["Location_007","Location_008","Location_009",]),
+    }
+
+2. Iterate over each cluster:
+
+2.1. First cluster is:
+    { (0, ["Location_000","Location_001",]) }
+
+    2.1.1. Get the current cost of using this cluster.
+        - Total costs * N locations = `(420042) * 2 = 840084`
+
+    2.1.2. Get cheaper common available measures:
+        - Soil Reinforcement, (idx=0),
+            - [Discard] Current selection.
+        - Vertical Piping Solution, (idx=1),
+            - Costs = `(420.420) * 2 = 840.840`
+            - [Discard] Costs are higher than initial state.
+        - Piping Wall, (idx=2),
+            - Costs = `(4.200 + 0) * 2 = 8.400`
+            - [Keep] Costs are cheaper than the initial state.
+        - Stability Wall, (idx=3),
+            - Costs = `(462.000) * 2 = 924.000`
+            - [Discard] Costs are higher than initial state.
+        - Cofferdam, (idx=3),
+            - Costs = `(420.000) * 2 = 840.000`
+            - [Keep] Costs are cheaper than the initial state, keep.
+
+    2.1.3. Set the cheapest common available measure per cluster:
+        - Piping wall < Cofferdam < Soil reinforcement (current)
+        - Piping wall is the new reinforcement for this cluster.
+
+    - Result: {(2, ["Location_000","Location_001",])}
+
+2.2. Second cluster is:
+    {(3, ["Location_002","Location_003",
+            "Location_004","Location_005",
+            "Location_006",])}
+
+    2.3.1. Get the current cost of using this cluster.
+        - Total costs * N locations = `(462.000) * 5 = 2.310.000`
+
+    2.3.2. Get cheaper common available measures.
+        - Soil Reinforcement, (idx=0),
+            - [Discard] Not present at "Location_003", "Location_004".
+        - Vertical Piping Solution, (idx=1),
+            - [Discard] Not present at "Location_003", "Location_004".
+        - Piping Wall, (idx=2),
+            - [Discard] Not present at "Location_003", "Location_004".
+        - Stability Wall, (idx=3),
+            - [Discard] Current selection.
+        - Cofferdam, (idx=3),
+            - Costs = `(420.000) * 5 = 2.100.000`
+            - [Keep] Costs are cheaper than the initial state.
+
+    2.3.3. Set the cheapest common available measure per cluster:
+        - Cofferdam < Stability wall
+        - Cofferdam is the new reinforcement for this cluster.
+
+    - Result : {(4, ["Location_002","Location_003",
+                    "Location_004","Location_005",
+                    "Location_006",])}
+
+2.3. Third cluster is:
+    { (4, ["Location_007","Location_008",
+            "Location_009",])}}
+
+    2.3.1. Get the current cost of using this cluster.
+        - Total costs * N locations = `(420.000) * 3 = 1.260.000`
+
+    2.3.2. Get cheaper common available measures.
+        - Cofferdam, (idx=4),
+            - Current selection.
+
+    2.3.3. Set the cheapest common available measure per cluster:
+        - Only cofferdam available,
+        - No further action.
+
+    - Result: {(4, ["Location_007","Location_008",
+                    "Location_009",])}
+
+2.4. Resulting clusters:
+    {
+        (2, ["Location_000","Location_001",]),
+        (4, ["Location_002","Location_003",
+                "Location_004","Location_005",
+                "Location_006","Location_007",
+                "Location_008","Location_009",]),
+    }
+
+

With this, we went from:

+
    +
  • Initial costs: (420.042) * 2 + (462.000) * 5 + (420.000) * 3 = 4.410.084, to
  • +
  • Final costs: (4.200) * 2 + (420.000) * 8 = 3.368.400
  • +
+

Which would amount to a total save of 1.041.684€

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/reference/koswat_surroundings.html b/reference/koswat_surroundings.html new file mode 100644 index 00000000..e40982dd --- /dev/null +++ b/reference/koswat_surroundings.html @@ -0,0 +1,309 @@ + + + + + + + + Surroundings - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

Surroundings

+

In koswat's real domain, a dike is surrounded by all sort of surroundings, these could be nature or human-built structures. During our analyisis we make use of (.shp) maps where a dike's traject is shown together with all the human-built structures in its proximity.

+

We categorize these structures in the following two types:

+
    +
  • Obstacles, surroundings that cannot be modified in any way.
  • +
  • Infrastructures, as opposite to the obstacles, surroundings that can be repaired or removed and added again (elsewhere).
  • +
+ + + + + + + + + + + +
Koswat dike surroundings representation
Image 1. Surroundings representation
+

To define said surroundings we make use of .csv files, each file for a specific type of surrounding that needs to be "enabled" in the koswat_general.ini settings file.

+

In addition, surroundings can be defined for the inside or the outside of a dike. At the current Koswat version (unreleased v0.15.0) we only support surroundings in the inside of a dike ( binnendijks).

+

Surroundings .csv files

+

The surroundings files follow all the same format both in naming and content.

+

Their file name has the form of T{dike_traject}_{type_of_surrounding}.csv: +- The {dike_traject} is the dike's traject code name, usually something like 10_1, +- the {type_of_surrounding} is the name of surrounding that will be imported (check further in the corresponding subsections of obstacles and infrastructure).

+

Their headers are divided in the following columns:

+
    +
  • SECTIE, section of the location in the dike's traject,
  • +
  • Xcoord, x coordinate of the location,
  • +
  • Ycoord, y coordinate of the location,
  • +
  • afst_{x}m, distance from the reference point of the location, where 'x' are all the values between 5 and 200 with steps of 5, thus 40 columns. The values in these cells define whether there are obstacles or infrastructures at this distance or not and in Koswat are usually built in the SurroundingsPoint.surroundings_matrix, each type of surrounding interprets the weights in a different manner.
  • +
+

Obstacles

+

An obstacle usually represents a building. Because they cannot be removed they become a constraint to the possible reinforcements that can be applied at a given location. For instance, if a dike's reinforcement will become 5 meters wider, but within that distance there are obstacles, said reinforcement will be discarded as a possible option at that location. +The distance from the reference point of the dike to the closes point of the obstacle is given.

+

The values in the columns afst_{x}m are either 1 or 0 and are simply interpreted as having a surrounding or not. Thus ignoring other characteristics of the surrounding and just focusing on its presence.

+

Obstacle types

+

Currently we identify and support the following surroundings as written in the .csv file names:

+
    +
  • bebouwing_binnendijks (buildings),
  • +
  • spoorwegen_binnendijks (railways),
  • +
  • waters_binnendijks (waters),
  • +
+

As reminder, at the moment we only support 'inside the dike's' surroundings.

+

Infrastructures

+

Infrastructures are mostly "roads". Contrary to the obstacles these infrastructures do not become a boundary for a reinforcement and they will simply be either displaced or repaired when applying a reinforcement requires their space. When this occurs, it is reflected as additional costs for the given type of reinforcement at that location. In short, these costs are calculated based on:

+
    +
  • The width of the infrastructure (taken from the Koswat_general.ini settings),
  • +
  • The length of the infrastructure at that location (the values in the columns afst_{x}m),
  • +
  • The required technique (repair, displace, nothing) for the type of infrastructure (also from koswat_general.ini settings) and its related costs (koswat_costs.ini).
  • +
+

With the above values we know what's the affected area of an infrastructure when a reinforced profile needs to be applied and therefore can estimate their costs.

+

The distance from the reference point of the dike to the center point of the infrastructure is given.

+

Infrastructures types

+

Currently we identify and support the following surroundings as written in the .csv file names:

+
    +
  • wegen_binnendijks_klasse2 (roads class 2),
  • +
  • wegen_binnendijks_klasse7 (roads class 7),
  • +
  • wegen_binnendijks_klasse24 (roads class 24),
  • +
  • wegen_binnendijks_klasse47 (roads class 47),
  • +
  • wegen_binnendijks_klasseonbekend (roads of unknown class),
  • +
+

As reminder, at the moment we only support 'inside the dike's' surroundings.

+

Surroundings in the code

+

But, how are these surroundings represented in the code? As earlier described, we distinguish surroundings by either obstacles or infrastructures. This is also reflected in the code where we create a general SurroundingsWrapper, which as the name states, wraps the obstacle and infrastructure surroundings in separate properties, each implementing an specialitzation of the BaseSurroundingsWrapper so that:

+
    +
  • ObstacleSurroundingsWrapper will wrap all the supported obstacle types, in separate properties of type SurroundingsObstacle.
  • +
  • InfrastructureSurroundingsWrapper will wrap all the supported infrastructure types, in separate properties of type SurroundingsInfrastructure.
  • +
+

A simple diagram illustrating the above can be seen in the image below:

+ + + + + + + + + + + +
Koswat surroundings in the code
Image 2. Surroundings code-wise
+

More detailed information can be found in the corresponding surroundings subproject.

+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + + diff --git a/search.html b/search.html new file mode 100644 index 00000000..a2065c5b --- /dev/null +++ b/search.html @@ -0,0 +1,201 @@ + + + + + + + + Koswat + + + + + + + + + + + + + +
+ + +
+ +
+
+
    +
  • »
  • +
  • +
  • +
+
+
+
+
+ + +

Search Results

+ + + +
+ Searching... +
+ + +
+
+ +
+
+ +
+ +
+ +
+ + + + + +
+ + + + + + + + diff --git a/search/lunr.js b/search/lunr.js new file mode 100644 index 00000000..aca0a167 --- /dev/null +++ b/search/lunr.js @@ -0,0 +1,3475 @@ +/** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + */ + +;(function(){ + +/** + * A convenience function for configuring and constructing + * a new lunr Index. + * + * A lunr.Builder instance is created and the pipeline setup + * with a trimmer, stop word filter and stemmer. + * + * This builder object is yielded to the configuration function + * that is passed as a parameter, allowing the list of fields + * and other builder parameters to be customised. + * + * All documents _must_ be added within the passed config function. + * + * @example + * var idx = lunr(function () { + * this.field('title') + * this.field('body') + * this.ref('id') + * + * documents.forEach(function (doc) { + * this.add(doc) + * }, this) + * }) + * + * @see {@link lunr.Builder} + * @see {@link lunr.Pipeline} + * @see {@link lunr.trimmer} + * @see {@link lunr.stopWordFilter} + * @see {@link lunr.stemmer} + * @namespace {function} lunr + */ +var lunr = function (config) { + var builder = new lunr.Builder + + builder.pipeline.add( + lunr.trimmer, + lunr.stopWordFilter, + lunr.stemmer + ) + + builder.searchPipeline.add( + lunr.stemmer + ) + + config.call(builder, builder) + return builder.build() +} + +lunr.version = "2.3.9" +/*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A namespace containing utils for the rest of the lunr library + * @namespace lunr.utils + */ +lunr.utils = {} + +/** + * Print a warning message to the console. + * + * @param {String} message The message to be printed. + * @memberOf lunr.utils + * @function + */ +lunr.utils.warn = (function (global) { + /* eslint-disable no-console */ + return function (message) { + if (global.console && console.warn) { + console.warn(message) + } + } + /* eslint-enable no-console */ +})(this) + +/** + * Convert an object to a string. + * + * In the case of `null` and `undefined` the function returns + * the empty string, in all other cases the result of calling + * `toString` on the passed object is returned. + * + * @param {Any} obj The object to convert to a string. + * @return {String} string representation of the passed object. + * @memberOf lunr.utils + */ +lunr.utils.asString = function (obj) { + if (obj === void 0 || obj === null) { + return "" + } else { + return obj.toString() + } +} + +/** + * Clones an object. + * + * Will create a copy of an existing object such that any mutations + * on the copy cannot affect the original. + * + * Only shallow objects are supported, passing a nested object to this + * function will cause a TypeError. + * + * Objects with primitives, and arrays of primitives are supported. + * + * @param {Object} obj The object to clone. + * @return {Object} a clone of the passed object. + * @throws {TypeError} when a nested object is passed. + * @memberOf Utils + */ +lunr.utils.clone = function (obj) { + if (obj === null || obj === undefined) { + return obj + } + + var clone = Object.create(null), + keys = Object.keys(obj) + + for (var i = 0; i < keys.length; i++) { + var key = keys[i], + val = obj[key] + + if (Array.isArray(val)) { + clone[key] = val.slice() + continue + } + + if (typeof val === 'string' || + typeof val === 'number' || + typeof val === 'boolean') { + clone[key] = val + continue + } + + throw new TypeError("clone is not deep and does not support nested objects") + } + + return clone +} +lunr.FieldRef = function (docRef, fieldName, stringValue) { + this.docRef = docRef + this.fieldName = fieldName + this._stringValue = stringValue +} + +lunr.FieldRef.joiner = "/" + +lunr.FieldRef.fromString = function (s) { + var n = s.indexOf(lunr.FieldRef.joiner) + + if (n === -1) { + throw "malformed field ref string" + } + + var fieldRef = s.slice(0, n), + docRef = s.slice(n + 1) + + return new lunr.FieldRef (docRef, fieldRef, s) +} + +lunr.FieldRef.prototype.toString = function () { + if (this._stringValue == undefined) { + this._stringValue = this.fieldName + lunr.FieldRef.joiner + this.docRef + } + + return this._stringValue +} +/*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A lunr set. + * + * @constructor + */ +lunr.Set = function (elements) { + this.elements = Object.create(null) + + if (elements) { + this.length = elements.length + + for (var i = 0; i < this.length; i++) { + this.elements[elements[i]] = true + } + } else { + this.length = 0 + } +} + +/** + * A complete set that contains all elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.complete = { + intersect: function (other) { + return other + }, + + union: function () { + return this + }, + + contains: function () { + return true + } +} + +/** + * An empty set that contains no elements. + * + * @static + * @readonly + * @type {lunr.Set} + */ +lunr.Set.empty = { + intersect: function () { + return this + }, + + union: function (other) { + return other + }, + + contains: function () { + return false + } +} + +/** + * Returns true if this set contains the specified object. + * + * @param {object} object - Object whose presence in this set is to be tested. + * @returns {boolean} - True if this set contains the specified object. + */ +lunr.Set.prototype.contains = function (object) { + return !!this.elements[object] +} + +/** + * Returns a new set containing only the elements that are present in both + * this set and the specified set. + * + * @param {lunr.Set} other - set to intersect with this set. + * @returns {lunr.Set} a new set that is the intersection of this and the specified set. + */ + +lunr.Set.prototype.intersect = function (other) { + var a, b, elements, intersection = [] + + if (other === lunr.Set.complete) { + return this + } + + if (other === lunr.Set.empty) { + return other + } + + if (this.length < other.length) { + a = this + b = other + } else { + a = other + b = this + } + + elements = Object.keys(a.elements) + + for (var i = 0; i < elements.length; i++) { + var element = elements[i] + if (element in b.elements) { + intersection.push(element) + } + } + + return new lunr.Set (intersection) +} + +/** + * Returns a new set combining the elements of this and the specified set. + * + * @param {lunr.Set} other - set to union with this set. + * @return {lunr.Set} a new set that is the union of this and the specified set. + */ + +lunr.Set.prototype.union = function (other) { + if (other === lunr.Set.complete) { + return lunr.Set.complete + } + + if (other === lunr.Set.empty) { + return this + } + + return new lunr.Set(Object.keys(this.elements).concat(Object.keys(other.elements))) +} +/** + * A function to calculate the inverse document frequency for + * a posting. This is shared between the builder and the index + * + * @private + * @param {object} posting - The posting for a given term + * @param {number} documentCount - The total number of documents. + */ +lunr.idf = function (posting, documentCount) { + var documentsWithTerm = 0 + + for (var fieldName in posting) { + if (fieldName == '_index') continue // Ignore the term index, its not a field + documentsWithTerm += Object.keys(posting[fieldName]).length + } + + var x = (documentCount - documentsWithTerm + 0.5) / (documentsWithTerm + 0.5) + + return Math.log(1 + Math.abs(x)) +} + +/** + * A token wraps a string representation of a token + * as it is passed through the text processing pipeline. + * + * @constructor + * @param {string} [str=''] - The string token being wrapped. + * @param {object} [metadata={}] - Metadata associated with this token. + */ +lunr.Token = function (str, metadata) { + this.str = str || "" + this.metadata = metadata || {} +} + +/** + * Returns the token string that is being wrapped by this object. + * + * @returns {string} + */ +lunr.Token.prototype.toString = function () { + return this.str +} + +/** + * A token update function is used when updating or optionally + * when cloning a token. + * + * @callback lunr.Token~updateFunction + * @param {string} str - The string representation of the token. + * @param {Object} metadata - All metadata associated with this token. + */ + +/** + * Applies the given function to the wrapped string token. + * + * @example + * token.update(function (str, metadata) { + * return str.toUpperCase() + * }) + * + * @param {lunr.Token~updateFunction} fn - A function to apply to the token string. + * @returns {lunr.Token} + */ +lunr.Token.prototype.update = function (fn) { + this.str = fn(this.str, this.metadata) + return this +} + +/** + * Creates a clone of this token. Optionally a function can be + * applied to the cloned token. + * + * @param {lunr.Token~updateFunction} [fn] - An optional function to apply to the cloned token. + * @returns {lunr.Token} + */ +lunr.Token.prototype.clone = function (fn) { + fn = fn || function (s) { return s } + return new lunr.Token (fn(this.str, this.metadata), this.metadata) +} +/*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A function for splitting a string into tokens ready to be inserted into + * the search index. Uses `lunr.tokenizer.separator` to split strings, change + * the value of this property to change how strings are split into tokens. + * + * This tokenizer will convert its parameter to a string by calling `toString` and + * then will split this string on the character in `lunr.tokenizer.separator`. + * Arrays will have their elements converted to strings and wrapped in a lunr.Token. + * + * Optional metadata can be passed to the tokenizer, this metadata will be cloned and + * added as metadata to every token that is created from the object to be tokenized. + * + * @static + * @param {?(string|object|object[])} obj - The object to convert into tokens + * @param {?object} metadata - Optional metadata to associate with every token + * @returns {lunr.Token[]} + * @see {@link lunr.Pipeline} + */ +lunr.tokenizer = function (obj, metadata) { + if (obj == null || obj == undefined) { + return [] + } + + if (Array.isArray(obj)) { + return obj.map(function (t) { + return new lunr.Token( + lunr.utils.asString(t).toLowerCase(), + lunr.utils.clone(metadata) + ) + }) + } + + var str = obj.toString().toLowerCase(), + len = str.length, + tokens = [] + + for (var sliceEnd = 0, sliceStart = 0; sliceEnd <= len; sliceEnd++) { + var char = str.charAt(sliceEnd), + sliceLength = sliceEnd - sliceStart + + if ((char.match(lunr.tokenizer.separator) || sliceEnd == len)) { + + if (sliceLength > 0) { + var tokenMetadata = lunr.utils.clone(metadata) || {} + tokenMetadata["position"] = [sliceStart, sliceLength] + tokenMetadata["index"] = tokens.length + + tokens.push( + new lunr.Token ( + str.slice(sliceStart, sliceEnd), + tokenMetadata + ) + ) + } + + sliceStart = sliceEnd + 1 + } + + } + + return tokens +} + +/** + * The separator used to split a string into tokens. Override this property to change the behaviour of + * `lunr.tokenizer` behaviour when tokenizing strings. By default this splits on whitespace and hyphens. + * + * @static + * @see lunr.tokenizer + */ +lunr.tokenizer.separator = /[\s\-]+/ +/*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Pipelines maintain an ordered list of functions to be applied to all + * tokens in documents entering the search index and queries being ran against + * the index. + * + * An instance of lunr.Index created with the lunr shortcut will contain a + * pipeline with a stop word filter and an English language stemmer. Extra + * functions can be added before or after either of these functions or these + * default functions can be removed. + * + * When run the pipeline will call each function in turn, passing a token, the + * index of that token in the original list of all tokens and finally a list of + * all the original tokens. + * + * The output of functions in the pipeline will be passed to the next function + * in the pipeline. To exclude a token from entering the index the function + * should return undefined, the rest of the pipeline will not be called with + * this token. + * + * For serialisation of pipelines to work, all functions used in an instance of + * a pipeline should be registered with lunr.Pipeline. Registered functions can + * then be loaded. If trying to load a serialised pipeline that uses functions + * that are not registered an error will be thrown. + * + * If not planning on serialising the pipeline then registering pipeline functions + * is not necessary. + * + * @constructor + */ +lunr.Pipeline = function () { + this._stack = [] +} + +lunr.Pipeline.registeredFunctions = Object.create(null) + +/** + * A pipeline function maps lunr.Token to lunr.Token. A lunr.Token contains the token + * string as well as all known metadata. A pipeline function can mutate the token string + * or mutate (or add) metadata for a given token. + * + * A pipeline function can indicate that the passed token should be discarded by returning + * null, undefined or an empty string. This token will not be passed to any downstream pipeline + * functions and will not be added to the index. + * + * Multiple tokens can be returned by returning an array of tokens. Each token will be passed + * to any downstream pipeline functions and all will returned tokens will be added to the index. + * + * Any number of pipeline functions may be chained together using a lunr.Pipeline. + * + * @interface lunr.PipelineFunction + * @param {lunr.Token} token - A token from the document being processed. + * @param {number} i - The index of this token in the complete list of tokens for this document/field. + * @param {lunr.Token[]} tokens - All tokens for this document/field. + * @returns {(?lunr.Token|lunr.Token[])} + */ + +/** + * Register a function with the pipeline. + * + * Functions that are used in the pipeline should be registered if the pipeline + * needs to be serialised, or a serialised pipeline needs to be loaded. + * + * Registering a function does not add it to a pipeline, functions must still be + * added to instances of the pipeline for them to be used when running a pipeline. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @param {String} label - The label to register this function with + */ +lunr.Pipeline.registerFunction = function (fn, label) { + if (label in this.registeredFunctions) { + lunr.utils.warn('Overwriting existing registered function: ' + label) + } + + fn.label = label + lunr.Pipeline.registeredFunctions[fn.label] = fn +} + +/** + * Warns if the function is not registered as a Pipeline function. + * + * @param {lunr.PipelineFunction} fn - The function to check for. + * @private + */ +lunr.Pipeline.warnIfFunctionNotRegistered = function (fn) { + var isRegistered = fn.label && (fn.label in this.registeredFunctions) + + if (!isRegistered) { + lunr.utils.warn('Function is not registered with pipeline. This may cause problems when serialising the index.\n', fn) + } +} + +/** + * Loads a previously serialised pipeline. + * + * All functions to be loaded must already be registered with lunr.Pipeline. + * If any function from the serialised data has not been registered then an + * error will be thrown. + * + * @param {Object} serialised - The serialised pipeline to load. + * @returns {lunr.Pipeline} + */ +lunr.Pipeline.load = function (serialised) { + var pipeline = new lunr.Pipeline + + serialised.forEach(function (fnName) { + var fn = lunr.Pipeline.registeredFunctions[fnName] + + if (fn) { + pipeline.add(fn) + } else { + throw new Error('Cannot load unregistered function: ' + fnName) + } + }) + + return pipeline +} + +/** + * Adds new functions to the end of the pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction[]} functions - Any number of functions to add to the pipeline. + */ +lunr.Pipeline.prototype.add = function () { + var fns = Array.prototype.slice.call(arguments) + + fns.forEach(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + this._stack.push(fn) + }, this) +} + +/** + * Adds a single function after a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.after = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + pos = pos + 1 + this._stack.splice(pos, 0, newFn) +} + +/** + * Adds a single function before a function that already exists in the + * pipeline. + * + * Logs a warning if the function has not been registered. + * + * @param {lunr.PipelineFunction} existingFn - A function that already exists in the pipeline. + * @param {lunr.PipelineFunction} newFn - The new function to add to the pipeline. + */ +lunr.Pipeline.prototype.before = function (existingFn, newFn) { + lunr.Pipeline.warnIfFunctionNotRegistered(newFn) + + var pos = this._stack.indexOf(existingFn) + if (pos == -1) { + throw new Error('Cannot find existingFn') + } + + this._stack.splice(pos, 0, newFn) +} + +/** + * Removes a function from the pipeline. + * + * @param {lunr.PipelineFunction} fn The function to remove from the pipeline. + */ +lunr.Pipeline.prototype.remove = function (fn) { + var pos = this._stack.indexOf(fn) + if (pos == -1) { + return + } + + this._stack.splice(pos, 1) +} + +/** + * Runs the current list of functions that make up the pipeline against the + * passed tokens. + * + * @param {Array} tokens The tokens to run through the pipeline. + * @returns {Array} + */ +lunr.Pipeline.prototype.run = function (tokens) { + var stackLength = this._stack.length + + for (var i = 0; i < stackLength; i++) { + var fn = this._stack[i] + var memo = [] + + for (var j = 0; j < tokens.length; j++) { + var result = fn(tokens[j], j, tokens) + + if (result === null || result === void 0 || result === '') continue + + if (Array.isArray(result)) { + for (var k = 0; k < result.length; k++) { + memo.push(result[k]) + } + } else { + memo.push(result) + } + } + + tokens = memo + } + + return tokens +} + +/** + * Convenience method for passing a string through a pipeline and getting + * strings out. This method takes care of wrapping the passed string in a + * token and mapping the resulting tokens back to strings. + * + * @param {string} str - The string to pass through the pipeline. + * @param {?object} metadata - Optional metadata to associate with the token + * passed to the pipeline. + * @returns {string[]} + */ +lunr.Pipeline.prototype.runString = function (str, metadata) { + var token = new lunr.Token (str, metadata) + + return this.run([token]).map(function (t) { + return t.toString() + }) +} + +/** + * Resets the pipeline by removing any existing processors. + * + */ +lunr.Pipeline.prototype.reset = function () { + this._stack = [] +} + +/** + * Returns a representation of the pipeline ready for serialisation. + * + * Logs a warning if the function has not been registered. + * + * @returns {Array} + */ +lunr.Pipeline.prototype.toJSON = function () { + return this._stack.map(function (fn) { + lunr.Pipeline.warnIfFunctionNotRegistered(fn) + + return fn.label + }) +} +/*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A vector is used to construct the vector space of documents and queries. These + * vectors support operations to determine the similarity between two documents or + * a document and a query. + * + * Normally no parameters are required for initializing a vector, but in the case of + * loading a previously dumped vector the raw elements can be provided to the constructor. + * + * For performance reasons vectors are implemented with a flat array, where an elements + * index is immediately followed by its value. E.g. [index, value, index, value]. This + * allows the underlying array to be as sparse as possible and still offer decent + * performance when being used for vector calculations. + * + * @constructor + * @param {Number[]} [elements] - The flat list of element index and element value pairs. + */ +lunr.Vector = function (elements) { + this._magnitude = 0 + this.elements = elements || [] +} + + +/** + * Calculates the position within the vector to insert a given index. + * + * This is used internally by insert and upsert. If there are duplicate indexes then + * the position is returned as if the value for that index were to be updated, but it + * is the callers responsibility to check whether there is a duplicate at that index + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @returns {Number} + */ +lunr.Vector.prototype.positionForIndex = function (index) { + // For an empty vector the tuple can be inserted at the beginning + if (this.elements.length == 0) { + return 0 + } + + var start = 0, + end = this.elements.length / 2, + sliceLength = end - start, + pivotPoint = Math.floor(sliceLength / 2), + pivotIndex = this.elements[pivotPoint * 2] + + while (sliceLength > 1) { + if (pivotIndex < index) { + start = pivotPoint + } + + if (pivotIndex > index) { + end = pivotPoint + } + + if (pivotIndex == index) { + break + } + + sliceLength = end - start + pivotPoint = start + Math.floor(sliceLength / 2) + pivotIndex = this.elements[pivotPoint * 2] + } + + if (pivotIndex == index) { + return pivotPoint * 2 + } + + if (pivotIndex > index) { + return pivotPoint * 2 + } + + if (pivotIndex < index) { + return (pivotPoint + 1) * 2 + } +} + +/** + * Inserts an element at an index within the vector. + * + * Does not allow duplicates, will throw an error if there is already an entry + * for this index. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + */ +lunr.Vector.prototype.insert = function (insertIdx, val) { + this.upsert(insertIdx, val, function () { + throw "duplicate index" + }) +} + +/** + * Inserts or updates an existing index within the vector. + * + * @param {Number} insertIdx - The index at which the element should be inserted. + * @param {Number} val - The value to be inserted into the vector. + * @param {function} fn - A function that is called for updates, the existing value and the + * requested value are passed as arguments + */ +lunr.Vector.prototype.upsert = function (insertIdx, val, fn) { + this._magnitude = 0 + var position = this.positionForIndex(insertIdx) + + if (this.elements[position] == insertIdx) { + this.elements[position + 1] = fn(this.elements[position + 1], val) + } else { + this.elements.splice(position, 0, insertIdx, val) + } +} + +/** + * Calculates the magnitude of this vector. + * + * @returns {Number} + */ +lunr.Vector.prototype.magnitude = function () { + if (this._magnitude) return this._magnitude + + var sumOfSquares = 0, + elementsLength = this.elements.length + + for (var i = 1; i < elementsLength; i += 2) { + var val = this.elements[i] + sumOfSquares += val * val + } + + return this._magnitude = Math.sqrt(sumOfSquares) +} + +/** + * Calculates the dot product of this vector and another vector. + * + * @param {lunr.Vector} otherVector - The vector to compute the dot product with. + * @returns {Number} + */ +lunr.Vector.prototype.dot = function (otherVector) { + var dotProduct = 0, + a = this.elements, b = otherVector.elements, + aLen = a.length, bLen = b.length, + aVal = 0, bVal = 0, + i = 0, j = 0 + + while (i < aLen && j < bLen) { + aVal = a[i], bVal = b[j] + if (aVal < bVal) { + i += 2 + } else if (aVal > bVal) { + j += 2 + } else if (aVal == bVal) { + dotProduct += a[i + 1] * b[j + 1] + i += 2 + j += 2 + } + } + + return dotProduct +} + +/** + * Calculates the similarity between this vector and another vector. + * + * @param {lunr.Vector} otherVector - The other vector to calculate the + * similarity with. + * @returns {Number} + */ +lunr.Vector.prototype.similarity = function (otherVector) { + return this.dot(otherVector) / this.magnitude() || 0 +} + +/** + * Converts the vector to an array of the elements within the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toArray = function () { + var output = new Array (this.elements.length / 2) + + for (var i = 1, j = 0; i < this.elements.length; i += 2, j++) { + output[j] = this.elements[i] + } + + return output +} + +/** + * A JSON serializable representation of the vector. + * + * @returns {Number[]} + */ +lunr.Vector.prototype.toJSON = function () { + return this.elements +} +/* eslint-disable */ +/*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + */ + +/** + * lunr.stemmer is an english language stemmer, this is a JavaScript + * implementation of the PorterStemmer taken from http://tartarus.org/~martin + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token - The string to stem + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + * @function + */ +lunr.stemmer = (function(){ + var step2list = { + "ational" : "ate", + "tional" : "tion", + "enci" : "ence", + "anci" : "ance", + "izer" : "ize", + "bli" : "ble", + "alli" : "al", + "entli" : "ent", + "eli" : "e", + "ousli" : "ous", + "ization" : "ize", + "ation" : "ate", + "ator" : "ate", + "alism" : "al", + "iveness" : "ive", + "fulness" : "ful", + "ousness" : "ous", + "aliti" : "al", + "iviti" : "ive", + "biliti" : "ble", + "logi" : "log" + }, + + step3list = { + "icate" : "ic", + "ative" : "", + "alize" : "al", + "iciti" : "ic", + "ical" : "ic", + "ful" : "", + "ness" : "" + }, + + c = "[^aeiou]", // consonant + v = "[aeiouy]", // vowel + C = c + "[^aeiouy]*", // consonant sequence + V = v + "[aeiou]*", // vowel sequence + + mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 + meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 + mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 + s_v = "^(" + C + ")?" + v; // vowel in stem + + var re_mgr0 = new RegExp(mgr0); + var re_mgr1 = new RegExp(mgr1); + var re_meq1 = new RegExp(meq1); + var re_s_v = new RegExp(s_v); + + var re_1a = /^(.+?)(ss|i)es$/; + var re2_1a = /^(.+?)([^s])s$/; + var re_1b = /^(.+?)eed$/; + var re2_1b = /^(.+?)(ed|ing)$/; + var re_1b_2 = /.$/; + var re2_1b_2 = /(at|bl|iz)$/; + var re3_1b_2 = new RegExp("([^aeiouylsz])\\1$"); + var re4_1b_2 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var re_1c = /^(.+?[^aeiou])y$/; + var re_2 = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + + var re_3 = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + + var re_4 = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + var re2_4 = /^(.+?)(s|t)(ion)$/; + + var re_5 = /^(.+?)e$/; + var re_5_1 = /ll$/; + var re3_5 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + + var porterStemmer = function porterStemmer(w) { + var stem, + suffix, + firstch, + re, + re2, + re3, + re4; + + if (w.length < 3) { return w; } + + firstch = w.substr(0,1); + if (firstch == "y") { + w = firstch.toUpperCase() + w.substr(1); + } + + // Step 1a + re = re_1a + re2 = re2_1a; + + if (re.test(w)) { w = w.replace(re,"$1$2"); } + else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } + + // Step 1b + re = re_1b; + re2 = re2_1b; + if (re.test(w)) { + var fp = re.exec(w); + re = re_mgr0; + if (re.test(fp[1])) { + re = re_1b_2; + w = w.replace(re,""); + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = re_s_v; + if (re2.test(stem)) { + w = stem; + re2 = re2_1b_2; + re3 = re3_1b_2; + re4 = re4_1b_2; + if (re2.test(w)) { w = w + "e"; } + else if (re3.test(w)) { re = re_1b_2; w = w.replace(re,""); } + else if (re4.test(w)) { w = w + "e"; } + } + } + + // Step 1c - replace suffix y or Y by i if preceded by a non-vowel which is not the first letter of the word (so cry -> cri, by -> by, say -> say) + re = re_1c; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + w = stem + "i"; + } + + // Step 2 + re = re_2; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step2list[suffix]; + } + } + + // Step 3 + re = re_3; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = re_mgr0; + if (re.test(stem)) { + w = stem + step3list[suffix]; + } + } + + // Step 4 + re = re_4; + re2 = re2_4; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + if (re.test(stem)) { + w = stem; + } + } else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = re_mgr1; + if (re2.test(stem)) { + w = stem; + } + } + + // Step 5 + re = re_5; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = re_mgr1; + re2 = re_meq1; + re3 = re3_5; + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { + w = stem; + } + } + + re = re_5_1; + re2 = re_mgr1; + if (re.test(w) && re2.test(w)) { + re = re_1b_2; + w = w.replace(re,""); + } + + // and turn initial Y back to y + + if (firstch == "y") { + w = firstch.toLowerCase() + w.substr(1); + } + + return w; + }; + + return function (token) { + return token.update(porterStemmer); + } +})(); + +lunr.Pipeline.registerFunction(lunr.stemmer, 'stemmer') +/*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.generateStopWordFilter builds a stopWordFilter function from the provided + * list of stop words. + * + * The built in lunr.stopWordFilter is built using this generator and can be used + * to generate custom stopWordFilters for applications or non English languages. + * + * @function + * @param {Array} token The token to pass through the filter + * @returns {lunr.PipelineFunction} + * @see lunr.Pipeline + * @see lunr.stopWordFilter + */ +lunr.generateStopWordFilter = function (stopWords) { + var words = stopWords.reduce(function (memo, stopWord) { + memo[stopWord] = stopWord + return memo + }, {}) + + return function (token) { + if (token && words[token.toString()] !== token.toString()) return token + } +} + +/** + * lunr.stopWordFilter is an English language stop word list filter, any words + * contained in the list will not be passed through the filter. + * + * This is intended to be used in the Pipeline. If the token does not pass the + * filter then undefined will be returned. + * + * @function + * @implements {lunr.PipelineFunction} + * @params {lunr.Token} token - A token to check for being a stop word. + * @returns {lunr.Token} + * @see {@link lunr.Pipeline} + */ +lunr.stopWordFilter = lunr.generateStopWordFilter([ + 'a', + 'able', + 'about', + 'across', + 'after', + 'all', + 'almost', + 'also', + 'am', + 'among', + 'an', + 'and', + 'any', + 'are', + 'as', + 'at', + 'be', + 'because', + 'been', + 'but', + 'by', + 'can', + 'cannot', + 'could', + 'dear', + 'did', + 'do', + 'does', + 'either', + 'else', + 'ever', + 'every', + 'for', + 'from', + 'get', + 'got', + 'had', + 'has', + 'have', + 'he', + 'her', + 'hers', + 'him', + 'his', + 'how', + 'however', + 'i', + 'if', + 'in', + 'into', + 'is', + 'it', + 'its', + 'just', + 'least', + 'let', + 'like', + 'likely', + 'may', + 'me', + 'might', + 'most', + 'must', + 'my', + 'neither', + 'no', + 'nor', + 'not', + 'of', + 'off', + 'often', + 'on', + 'only', + 'or', + 'other', + 'our', + 'own', + 'rather', + 'said', + 'say', + 'says', + 'she', + 'should', + 'since', + 'so', + 'some', + 'than', + 'that', + 'the', + 'their', + 'them', + 'then', + 'there', + 'these', + 'they', + 'this', + 'tis', + 'to', + 'too', + 'twas', + 'us', + 'wants', + 'was', + 'we', + 'were', + 'what', + 'when', + 'where', + 'which', + 'while', + 'who', + 'whom', + 'why', + 'will', + 'with', + 'would', + 'yet', + 'you', + 'your' +]) + +lunr.Pipeline.registerFunction(lunr.stopWordFilter, 'stopWordFilter') +/*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.trimmer is a pipeline function for trimming non word + * characters from the beginning and end of tokens before they + * enter the index. + * + * This implementation may not work correctly for non latin + * characters and should either be removed or adapted for use + * with languages with non-latin characters. + * + * @static + * @implements {lunr.PipelineFunction} + * @param {lunr.Token} token The token to pass through the filter + * @returns {lunr.Token} + * @see lunr.Pipeline + */ +lunr.trimmer = function (token) { + return token.update(function (s) { + return s.replace(/^\W+/, '').replace(/\W+$/, '') + }) +} + +lunr.Pipeline.registerFunction(lunr.trimmer, 'trimmer') +/*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * A token set is used to store the unique list of all tokens + * within an index. Token sets are also used to represent an + * incoming query to the index, this query token set and index + * token set are then intersected to find which tokens to look + * up in the inverted index. + * + * A token set can hold multiple tokens, as in the case of the + * index token set, or it can hold a single token as in the + * case of a simple query token set. + * + * Additionally token sets are used to perform wildcard matching. + * Leading, contained and trailing wildcards are supported, and + * from this edit distance matching can also be provided. + * + * Token sets are implemented as a minimal finite state automata, + * where both common prefixes and suffixes are shared between tokens. + * This helps to reduce the space used for storing the token set. + * + * @constructor + */ +lunr.TokenSet = function () { + this.final = false + this.edges = {} + this.id = lunr.TokenSet._nextId + lunr.TokenSet._nextId += 1 +} + +/** + * Keeps track of the next, auto increment, identifier to assign + * to a new tokenSet. + * + * TokenSets require a unique identifier to be correctly minimised. + * + * @private + */ +lunr.TokenSet._nextId = 1 + +/** + * Creates a TokenSet instance from the given sorted array of words. + * + * @param {String[]} arr - A sorted array of strings to create the set from. + * @returns {lunr.TokenSet} + * @throws Will throw an error if the input array is not sorted. + */ +lunr.TokenSet.fromArray = function (arr) { + var builder = new lunr.TokenSet.Builder + + for (var i = 0, len = arr.length; i < len; i++) { + builder.insert(arr[i]) + } + + builder.finish() + return builder.root +} + +/** + * Creates a token set from a query clause. + * + * @private + * @param {Object} clause - A single clause from lunr.Query. + * @param {string} clause.term - The query clause term. + * @param {number} [clause.editDistance] - The optional edit distance for the term. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromClause = function (clause) { + if ('editDistance' in clause) { + return lunr.TokenSet.fromFuzzyString(clause.term, clause.editDistance) + } else { + return lunr.TokenSet.fromString(clause.term) + } +} + +/** + * Creates a token set representing a single string with a specified + * edit distance. + * + * Insertions, deletions, substitutions and transpositions are each + * treated as an edit distance of 1. + * + * Increasing the allowed edit distance will have a dramatic impact + * on the performance of both creating and intersecting these TokenSets. + * It is advised to keep the edit distance less than 3. + * + * @param {string} str - The string to create the token set from. + * @param {number} editDistance - The allowed edit distance to match. + * @returns {lunr.Vector} + */ +lunr.TokenSet.fromFuzzyString = function (str, editDistance) { + var root = new lunr.TokenSet + + var stack = [{ + node: root, + editsRemaining: editDistance, + str: str + }] + + while (stack.length) { + var frame = stack.pop() + + // no edit + if (frame.str.length > 0) { + var char = frame.str.charAt(0), + noEditNode + + if (char in frame.node.edges) { + noEditNode = frame.node.edges[char] + } else { + noEditNode = new lunr.TokenSet + frame.node.edges[char] = noEditNode + } + + if (frame.str.length == 1) { + noEditNode.final = true + } + + stack.push({ + node: noEditNode, + editsRemaining: frame.editsRemaining, + str: frame.str.slice(1) + }) + } + + if (frame.editsRemaining == 0) { + continue + } + + // insertion + if ("*" in frame.node.edges) { + var insertionNode = frame.node.edges["*"] + } else { + var insertionNode = new lunr.TokenSet + frame.node.edges["*"] = insertionNode + } + + if (frame.str.length == 0) { + insertionNode.final = true + } + + stack.push({ + node: insertionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str + }) + + // deletion + // can only do a deletion if we have enough edits remaining + // and if there are characters left to delete in the string + if (frame.str.length > 1) { + stack.push({ + node: frame.node, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // deletion + // just removing the last character from the str + if (frame.str.length == 1) { + frame.node.final = true + } + + // substitution + // can only do a substitution if we have enough edits remaining + // and if there are characters left to substitute + if (frame.str.length >= 1) { + if ("*" in frame.node.edges) { + var substitutionNode = frame.node.edges["*"] + } else { + var substitutionNode = new lunr.TokenSet + frame.node.edges["*"] = substitutionNode + } + + if (frame.str.length == 1) { + substitutionNode.final = true + } + + stack.push({ + node: substitutionNode, + editsRemaining: frame.editsRemaining - 1, + str: frame.str.slice(1) + }) + } + + // transposition + // can only do a transposition if there are edits remaining + // and there are enough characters to transpose + if (frame.str.length > 1) { + var charA = frame.str.charAt(0), + charB = frame.str.charAt(1), + transposeNode + + if (charB in frame.node.edges) { + transposeNode = frame.node.edges[charB] + } else { + transposeNode = new lunr.TokenSet + frame.node.edges[charB] = transposeNode + } + + if (frame.str.length == 1) { + transposeNode.final = true + } + + stack.push({ + node: transposeNode, + editsRemaining: frame.editsRemaining - 1, + str: charA + frame.str.slice(2) + }) + } + } + + return root +} + +/** + * Creates a TokenSet from a string. + * + * The string may contain one or more wildcard characters (*) + * that will allow wildcard matching when intersecting with + * another TokenSet. + * + * @param {string} str - The string to create a TokenSet from. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.fromString = function (str) { + var node = new lunr.TokenSet, + root = node + + /* + * Iterates through all characters within the passed string + * appending a node for each character. + * + * When a wildcard character is found then a self + * referencing edge is introduced to continually match + * any number of any characters. + */ + for (var i = 0, len = str.length; i < len; i++) { + var char = str[i], + final = (i == len - 1) + + if (char == "*") { + node.edges[char] = node + node.final = final + + } else { + var next = new lunr.TokenSet + next.final = final + + node.edges[char] = next + node = next + } + } + + return root +} + +/** + * Converts this TokenSet into an array of strings + * contained within the TokenSet. + * + * This is not intended to be used on a TokenSet that + * contains wildcards, in these cases the results are + * undefined and are likely to cause an infinite loop. + * + * @returns {string[]} + */ +lunr.TokenSet.prototype.toArray = function () { + var words = [] + + var stack = [{ + prefix: "", + node: this + }] + + while (stack.length) { + var frame = stack.pop(), + edges = Object.keys(frame.node.edges), + len = edges.length + + if (frame.node.final) { + /* In Safari, at this point the prefix is sometimes corrupted, see: + * https://github.com/olivernn/lunr.js/issues/279 Calling any + * String.prototype method forces Safari to "cast" this string to what + * it's supposed to be, fixing the bug. */ + frame.prefix.charAt(0) + words.push(frame.prefix) + } + + for (var i = 0; i < len; i++) { + var edge = edges[i] + + stack.push({ + prefix: frame.prefix.concat(edge), + node: frame.node.edges[edge] + }) + } + } + + return words +} + +/** + * Generates a string representation of a TokenSet. + * + * This is intended to allow TokenSets to be used as keys + * in objects, largely to aid the construction and minimisation + * of a TokenSet. As such it is not designed to be a human + * friendly representation of the TokenSet. + * + * @returns {string} + */ +lunr.TokenSet.prototype.toString = function () { + // NOTE: Using Object.keys here as this.edges is very likely + // to enter 'hash-mode' with many keys being added + // + // avoiding a for-in loop here as it leads to the function + // being de-optimised (at least in V8). From some simple + // benchmarks the performance is comparable, but allowing + // V8 to optimize may mean easy performance wins in the future. + + if (this._str) { + return this._str + } + + var str = this.final ? '1' : '0', + labels = Object.keys(this.edges).sort(), + len = labels.length + + for (var i = 0; i < len; i++) { + var label = labels[i], + node = this.edges[label] + + str = str + label + node.id + } + + return str +} + +/** + * Returns a new TokenSet that is the intersection of + * this TokenSet and the passed TokenSet. + * + * This intersection will take into account any wildcards + * contained within the TokenSet. + * + * @param {lunr.TokenSet} b - An other TokenSet to intersect with. + * @returns {lunr.TokenSet} + */ +lunr.TokenSet.prototype.intersect = function (b) { + var output = new lunr.TokenSet, + frame = undefined + + var stack = [{ + qNode: b, + output: output, + node: this + }] + + while (stack.length) { + frame = stack.pop() + + // NOTE: As with the #toString method, we are using + // Object.keys and a for loop instead of a for-in loop + // as both of these objects enter 'hash' mode, causing + // the function to be de-optimised in V8 + var qEdges = Object.keys(frame.qNode.edges), + qLen = qEdges.length, + nEdges = Object.keys(frame.node.edges), + nLen = nEdges.length + + for (var q = 0; q < qLen; q++) { + var qEdge = qEdges[q] + + for (var n = 0; n < nLen; n++) { + var nEdge = nEdges[n] + + if (nEdge == qEdge || qEdge == '*') { + var node = frame.node.edges[nEdge], + qNode = frame.qNode.edges[qEdge], + final = node.final && qNode.final, + next = undefined + + if (nEdge in frame.output.edges) { + // an edge already exists for this character + // no need to create a new node, just set the finality + // bit unless this node is already final + next = frame.output.edges[nEdge] + next.final = next.final || final + + } else { + // no edge exists yet, must create one + // set the finality bit and insert it + // into the output + next = new lunr.TokenSet + next.final = final + frame.output.edges[nEdge] = next + } + + stack.push({ + qNode: qNode, + output: next, + node: node + }) + } + } + } + } + + return output +} +lunr.TokenSet.Builder = function () { + this.previousWord = "" + this.root = new lunr.TokenSet + this.uncheckedNodes = [] + this.minimizedNodes = {} +} + +lunr.TokenSet.Builder.prototype.insert = function (word) { + var node, + commonPrefix = 0 + + if (word < this.previousWord) { + throw new Error ("Out of order word insertion") + } + + for (var i = 0; i < word.length && i < this.previousWord.length; i++) { + if (word[i] != this.previousWord[i]) break + commonPrefix++ + } + + this.minimize(commonPrefix) + + if (this.uncheckedNodes.length == 0) { + node = this.root + } else { + node = this.uncheckedNodes[this.uncheckedNodes.length - 1].child + } + + for (var i = commonPrefix; i < word.length; i++) { + var nextNode = new lunr.TokenSet, + char = word[i] + + node.edges[char] = nextNode + + this.uncheckedNodes.push({ + parent: node, + char: char, + child: nextNode + }) + + node = nextNode + } + + node.final = true + this.previousWord = word +} + +lunr.TokenSet.Builder.prototype.finish = function () { + this.minimize(0) +} + +lunr.TokenSet.Builder.prototype.minimize = function (downTo) { + for (var i = this.uncheckedNodes.length - 1; i >= downTo; i--) { + var node = this.uncheckedNodes[i], + childKey = node.child.toString() + + if (childKey in this.minimizedNodes) { + node.parent.edges[node.char] = this.minimizedNodes[childKey] + } else { + // Cache the key for this node since + // we know it can't change anymore + node.child._str = childKey + + this.minimizedNodes[childKey] = node.child + } + + this.uncheckedNodes.pop() + } +} +/*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * An index contains the built index of all documents and provides a query interface + * to the index. + * + * Usually instances of lunr.Index will not be created using this constructor, instead + * lunr.Builder should be used to construct new indexes, or lunr.Index.load should be + * used to load previously built and serialized indexes. + * + * @constructor + * @param {Object} attrs - The attributes of the built search index. + * @param {Object} attrs.invertedIndex - An index of term/field to document reference. + * @param {Object} attrs.fieldVectors - Field vectors + * @param {lunr.TokenSet} attrs.tokenSet - An set of all corpus tokens. + * @param {string[]} attrs.fields - The names of indexed document fields. + * @param {lunr.Pipeline} attrs.pipeline - The pipeline to use for search terms. + */ +lunr.Index = function (attrs) { + this.invertedIndex = attrs.invertedIndex + this.fieldVectors = attrs.fieldVectors + this.tokenSet = attrs.tokenSet + this.fields = attrs.fields + this.pipeline = attrs.pipeline +} + +/** + * A result contains details of a document matching a search query. + * @typedef {Object} lunr.Index~Result + * @property {string} ref - The reference of the document this result represents. + * @property {number} score - A number between 0 and 1 representing how similar this document is to the query. + * @property {lunr.MatchData} matchData - Contains metadata about this match including which term(s) caused the match. + */ + +/** + * Although lunr provides the ability to create queries using lunr.Query, it also provides a simple + * query language which itself is parsed into an instance of lunr.Query. + * + * For programmatically building queries it is advised to directly use lunr.Query, the query language + * is best used for human entered text rather than program generated text. + * + * At its simplest queries can just be a single term, e.g. `hello`, multiple terms are also supported + * and will be combined with OR, e.g `hello world` will match documents that contain either 'hello' + * or 'world', though those that contain both will rank higher in the results. + * + * Wildcards can be included in terms to match one or more unspecified characters, these wildcards can + * be inserted anywhere within the term, and more than one wildcard can exist in a single term. Adding + * wildcards will increase the number of documents that will be found but can also have a negative + * impact on query performance, especially with wildcards at the beginning of a term. + * + * Terms can be restricted to specific fields, e.g. `title:hello`, only documents with the term + * hello in the title field will match this query. Using a field not present in the index will lead + * to an error being thrown. + * + * Modifiers can also be added to terms, lunr supports edit distance and boost modifiers on terms. A term + * boost will make documents matching that term score higher, e.g. `foo^5`. Edit distance is also supported + * to provide fuzzy matching, e.g. 'hello~2' will match documents with hello with an edit distance of 2. + * Avoid large values for edit distance to improve query performance. + * + * Each term also supports a presence modifier. By default a term's presence in document is optional, however + * this can be changed to either required or prohibited. For a term's presence to be required in a document the + * term should be prefixed with a '+', e.g. `+foo bar` is a search for documents that must contain 'foo' and + * optionally contain 'bar'. Conversely a leading '-' sets the terms presence to prohibited, i.e. it must not + * appear in a document, e.g. `-foo bar` is a search for documents that do not contain 'foo' but may contain 'bar'. + * + * To escape special characters the backslash character '\' can be used, this allows searches to include + * characters that would normally be considered modifiers, e.g. `foo\~2` will search for a term "foo~2" instead + * of attempting to apply a boost of 2 to the search term "foo". + * + * @typedef {string} lunr.Index~QueryString + * @example Simple single term query + * hello + * @example Multiple term query + * hello world + * @example term scoped to a field + * title:hello + * @example term with a boost of 10 + * hello^10 + * @example term with an edit distance of 2 + * hello~2 + * @example terms with presence modifiers + * -foo +bar baz + */ + +/** + * Performs a search against the index using lunr query syntax. + * + * Results will be returned sorted by their score, the most relevant results + * will be returned first. For details on how the score is calculated, please see + * the {@link https://lunrjs.com/guides/searching.html#scoring|guide}. + * + * For more programmatic querying use lunr.Index#query. + * + * @param {lunr.Index~QueryString} queryString - A string containing a lunr query. + * @throws {lunr.QueryParseError} If the passed query string cannot be parsed. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.search = function (queryString) { + return this.query(function (query) { + var parser = new lunr.QueryParser(queryString, query) + parser.parse() + }) +} + +/** + * A query builder callback provides a query object to be used to express + * the query to perform on the index. + * + * @callback lunr.Index~queryBuilder + * @param {lunr.Query} query - The query object to build up. + * @this lunr.Query + */ + +/** + * Performs a query against the index using the yielded lunr.Query object. + * + * If performing programmatic queries against the index, this method is preferred + * over lunr.Index#search so as to avoid the additional query parsing overhead. + * + * A query object is yielded to the supplied function which should be used to + * express the query to be run against the index. + * + * Note that although this function takes a callback parameter it is _not_ an + * asynchronous operation, the callback is just yielded a query object to be + * customized. + * + * @param {lunr.Index~queryBuilder} fn - A function that is used to build the query. + * @returns {lunr.Index~Result[]} + */ +lunr.Index.prototype.query = function (fn) { + // for each query clause + // * process terms + // * expand terms from token set + // * find matching documents and metadata + // * get document vectors + // * score documents + + var query = new lunr.Query(this.fields), + matchingFields = Object.create(null), + queryVectors = Object.create(null), + termFieldCache = Object.create(null), + requiredMatches = Object.create(null), + prohibitedMatches = Object.create(null) + + /* + * To support field level boosts a query vector is created per + * field. An empty vector is eagerly created to support negated + * queries. + */ + for (var i = 0; i < this.fields.length; i++) { + queryVectors[this.fields[i]] = new lunr.Vector + } + + fn.call(query, query) + + for (var i = 0; i < query.clauses.length; i++) { + /* + * Unless the pipeline has been disabled for this term, which is + * the case for terms with wildcards, we need to pass the clause + * term through the search pipeline. A pipeline returns an array + * of processed terms. Pipeline functions may expand the passed + * term, which means we may end up performing multiple index lookups + * for a single query term. + */ + var clause = query.clauses[i], + terms = null, + clauseMatches = lunr.Set.empty + + if (clause.usePipeline) { + terms = this.pipeline.runString(clause.term, { + fields: clause.fields + }) + } else { + terms = [clause.term] + } + + for (var m = 0; m < terms.length; m++) { + var term = terms[m] + + /* + * Each term returned from the pipeline needs to use the same query + * clause object, e.g. the same boost and or edit distance. The + * simplest way to do this is to re-use the clause object but mutate + * its term property. + */ + clause.term = term + + /* + * From the term in the clause we create a token set which will then + * be used to intersect the indexes token set to get a list of terms + * to lookup in the inverted index + */ + var termTokenSet = lunr.TokenSet.fromClause(clause), + expandedTerms = this.tokenSet.intersect(termTokenSet).toArray() + + /* + * If a term marked as required does not exist in the tokenSet it is + * impossible for the search to return any matches. We set all the field + * scoped required matches set to empty and stop examining any further + * clauses. + */ + if (expandedTerms.length === 0 && clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = lunr.Set.empty + } + + break + } + + for (var j = 0; j < expandedTerms.length; j++) { + /* + * For each term get the posting and termIndex, this is required for + * building the query vector. + */ + var expandedTerm = expandedTerms[j], + posting = this.invertedIndex[expandedTerm], + termIndex = posting._index + + for (var k = 0; k < clause.fields.length; k++) { + /* + * For each field that this query term is scoped by (by default + * all fields are in scope) we need to get all the document refs + * that have this term in that field. + * + * The posting is the entry in the invertedIndex for the matching + * term from above. + */ + var field = clause.fields[k], + fieldPosting = posting[field], + matchingDocumentRefs = Object.keys(fieldPosting), + termField = expandedTerm + "/" + field, + matchingDocumentsSet = new lunr.Set(matchingDocumentRefs) + + /* + * if the presence of this term is required ensure that the matching + * documents are added to the set of required matches for this clause. + * + */ + if (clause.presence == lunr.Query.presence.REQUIRED) { + clauseMatches = clauseMatches.union(matchingDocumentsSet) + + if (requiredMatches[field] === undefined) { + requiredMatches[field] = lunr.Set.complete + } + } + + /* + * if the presence of this term is prohibited ensure that the matching + * documents are added to the set of prohibited matches for this field, + * creating that set if it does not yet exist. + */ + if (clause.presence == lunr.Query.presence.PROHIBITED) { + if (prohibitedMatches[field] === undefined) { + prohibitedMatches[field] = lunr.Set.empty + } + + prohibitedMatches[field] = prohibitedMatches[field].union(matchingDocumentsSet) + + /* + * Prohibited matches should not be part of the query vector used for + * similarity scoring and no metadata should be extracted so we continue + * to the next field + */ + continue + } + + /* + * The query field vector is populated using the termIndex found for + * the term and a unit value with the appropriate boost applied. + * Using upsert because there could already be an entry in the vector + * for the term we are working with. In that case we just add the scores + * together. + */ + queryVectors[field].upsert(termIndex, clause.boost, function (a, b) { return a + b }) + + /** + * If we've already seen this term, field combo then we've already collected + * the matching documents and metadata, no need to go through all that again + */ + if (termFieldCache[termField]) { + continue + } + + for (var l = 0; l < matchingDocumentRefs.length; l++) { + /* + * All metadata for this term/field/document triple + * are then extracted and collected into an instance + * of lunr.MatchData ready to be returned in the query + * results + */ + var matchingDocumentRef = matchingDocumentRefs[l], + matchingFieldRef = new lunr.FieldRef (matchingDocumentRef, field), + metadata = fieldPosting[matchingDocumentRef], + fieldMatch + + if ((fieldMatch = matchingFields[matchingFieldRef]) === undefined) { + matchingFields[matchingFieldRef] = new lunr.MatchData (expandedTerm, field, metadata) + } else { + fieldMatch.add(expandedTerm, field, metadata) + } + + } + + termFieldCache[termField] = true + } + } + } + + /** + * If the presence was required we need to update the requiredMatches field sets. + * We do this after all fields for the term have collected their matches because + * the clause terms presence is required in _any_ of the fields not _all_ of the + * fields. + */ + if (clause.presence === lunr.Query.presence.REQUIRED) { + for (var k = 0; k < clause.fields.length; k++) { + var field = clause.fields[k] + requiredMatches[field] = requiredMatches[field].intersect(clauseMatches) + } + } + } + + /** + * Need to combine the field scoped required and prohibited + * matching documents into a global set of required and prohibited + * matches + */ + var allRequiredMatches = lunr.Set.complete, + allProhibitedMatches = lunr.Set.empty + + for (var i = 0; i < this.fields.length; i++) { + var field = this.fields[i] + + if (requiredMatches[field]) { + allRequiredMatches = allRequiredMatches.intersect(requiredMatches[field]) + } + + if (prohibitedMatches[field]) { + allProhibitedMatches = allProhibitedMatches.union(prohibitedMatches[field]) + } + } + + var matchingFieldRefs = Object.keys(matchingFields), + results = [], + matches = Object.create(null) + + /* + * If the query is negated (contains only prohibited terms) + * we need to get _all_ fieldRefs currently existing in the + * index. This is only done when we know that the query is + * entirely prohibited terms to avoid any cost of getting all + * fieldRefs unnecessarily. + * + * Additionally, blank MatchData must be created to correctly + * populate the results. + */ + if (query.isNegated()) { + matchingFieldRefs = Object.keys(this.fieldVectors) + + for (var i = 0; i < matchingFieldRefs.length; i++) { + var matchingFieldRef = matchingFieldRefs[i] + var fieldRef = lunr.FieldRef.fromString(matchingFieldRef) + matchingFields[matchingFieldRef] = new lunr.MatchData + } + } + + for (var i = 0; i < matchingFieldRefs.length; i++) { + /* + * Currently we have document fields that match the query, but we + * need to return documents. The matchData and scores are combined + * from multiple fields belonging to the same document. + * + * Scores are calculated by field, using the query vectors created + * above, and combined into a final document score using addition. + */ + var fieldRef = lunr.FieldRef.fromString(matchingFieldRefs[i]), + docRef = fieldRef.docRef + + if (!allRequiredMatches.contains(docRef)) { + continue + } + + if (allProhibitedMatches.contains(docRef)) { + continue + } + + var fieldVector = this.fieldVectors[fieldRef], + score = queryVectors[fieldRef.fieldName].similarity(fieldVector), + docMatch + + if ((docMatch = matches[docRef]) !== undefined) { + docMatch.score += score + docMatch.matchData.combine(matchingFields[fieldRef]) + } else { + var match = { + ref: docRef, + score: score, + matchData: matchingFields[fieldRef] + } + matches[docRef] = match + results.push(match) + } + } + + /* + * Sort the results objects by score, highest first. + */ + return results.sort(function (a, b) { + return b.score - a.score + }) +} + +/** + * Prepares the index for JSON serialization. + * + * The schema for this JSON blob will be described in a + * separate JSON schema file. + * + * @returns {Object} + */ +lunr.Index.prototype.toJSON = function () { + var invertedIndex = Object.keys(this.invertedIndex) + .sort() + .map(function (term) { + return [term, this.invertedIndex[term]] + }, this) + + var fieldVectors = Object.keys(this.fieldVectors) + .map(function (ref) { + return [ref, this.fieldVectors[ref].toJSON()] + }, this) + + return { + version: lunr.version, + fields: this.fields, + fieldVectors: fieldVectors, + invertedIndex: invertedIndex, + pipeline: this.pipeline.toJSON() + } +} + +/** + * Loads a previously serialized lunr.Index + * + * @param {Object} serializedIndex - A previously serialized lunr.Index + * @returns {lunr.Index} + */ +lunr.Index.load = function (serializedIndex) { + var attrs = {}, + fieldVectors = {}, + serializedVectors = serializedIndex.fieldVectors, + invertedIndex = Object.create(null), + serializedInvertedIndex = serializedIndex.invertedIndex, + tokenSetBuilder = new lunr.TokenSet.Builder, + pipeline = lunr.Pipeline.load(serializedIndex.pipeline) + + if (serializedIndex.version != lunr.version) { + lunr.utils.warn("Version mismatch when loading serialised index. Current version of lunr '" + lunr.version + "' does not match serialized index '" + serializedIndex.version + "'") + } + + for (var i = 0; i < serializedVectors.length; i++) { + var tuple = serializedVectors[i], + ref = tuple[0], + elements = tuple[1] + + fieldVectors[ref] = new lunr.Vector(elements) + } + + for (var i = 0; i < serializedInvertedIndex.length; i++) { + var tuple = serializedInvertedIndex[i], + term = tuple[0], + posting = tuple[1] + + tokenSetBuilder.insert(term) + invertedIndex[term] = posting + } + + tokenSetBuilder.finish() + + attrs.fields = serializedIndex.fields + + attrs.fieldVectors = fieldVectors + attrs.invertedIndex = invertedIndex + attrs.tokenSet = tokenSetBuilder.root + attrs.pipeline = pipeline + + return new lunr.Index(attrs) +} +/*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + */ + +/** + * lunr.Builder performs indexing on a set of documents and + * returns instances of lunr.Index ready for querying. + * + * All configuration of the index is done via the builder, the + * fields to index, the document reference, the text processing + * pipeline and document scoring parameters are all set on the + * builder before indexing. + * + * @constructor + * @property {string} _ref - Internal reference to the document reference field. + * @property {string[]} _fields - Internal reference to the document fields to index. + * @property {object} invertedIndex - The inverted index maps terms to document fields. + * @property {object} documentTermFrequencies - Keeps track of document term frequencies. + * @property {object} documentLengths - Keeps track of the length of documents added to the index. + * @property {lunr.tokenizer} tokenizer - Function for splitting strings into tokens for indexing. + * @property {lunr.Pipeline} pipeline - The pipeline performs text processing on tokens before indexing. + * @property {lunr.Pipeline} searchPipeline - A pipeline for processing search terms before querying the index. + * @property {number} documentCount - Keeps track of the total number of documents indexed. + * @property {number} _b - A parameter to control field length normalization, setting this to 0 disabled normalization, 1 fully normalizes field lengths, the default value is 0.75. + * @property {number} _k1 - A parameter to control how quickly an increase in term frequency results in term frequency saturation, the default value is 1.2. + * @property {number} termIndex - A counter incremented for each unique term, used to identify a terms position in the vector space. + * @property {array} metadataWhitelist - A list of metadata keys that have been whitelisted for entry in the index. + */ +lunr.Builder = function () { + this._ref = "id" + this._fields = Object.create(null) + this._documents = Object.create(null) + this.invertedIndex = Object.create(null) + this.fieldTermFrequencies = {} + this.fieldLengths = {} + this.tokenizer = lunr.tokenizer + this.pipeline = new lunr.Pipeline + this.searchPipeline = new lunr.Pipeline + this.documentCount = 0 + this._b = 0.75 + this._k1 = 1.2 + this.termIndex = 0 + this.metadataWhitelist = [] +} + +/** + * Sets the document field used as the document reference. Every document must have this field. + * The type of this field in the document should be a string, if it is not a string it will be + * coerced into a string by calling toString. + * + * The default ref is 'id'. + * + * The ref should _not_ be changed during indexing, it should be set before any documents are + * added to the index. Changing it during indexing can lead to inconsistent results. + * + * @param {string} ref - The name of the reference field in the document. + */ +lunr.Builder.prototype.ref = function (ref) { + this._ref = ref +} + +/** + * A function that is used to extract a field from a document. + * + * Lunr expects a field to be at the top level of a document, if however the field + * is deeply nested within a document an extractor function can be used to extract + * the right field for indexing. + * + * @callback fieldExtractor + * @param {object} doc - The document being added to the index. + * @returns {?(string|object|object[])} obj - The object that will be indexed for this field. + * @example Extracting a nested field + * function (doc) { return doc.nested.field } + */ + +/** + * Adds a field to the list of document fields that will be indexed. Every document being + * indexed should have this field. Null values for this field in indexed documents will + * not cause errors but will limit the chance of that document being retrieved by searches. + * + * All fields should be added before adding documents to the index. Adding fields after + * a document has been indexed will have no effect on already indexed documents. + * + * Fields can be boosted at build time. This allows terms within that field to have more + * importance when ranking search results. Use a field boost to specify that matches within + * one field are more important than other fields. + * + * @param {string} fieldName - The name of a field to index in all documents. + * @param {object} attributes - Optional attributes associated with this field. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this field. + * @param {fieldExtractor} [attributes.extractor] - Function to extract a field from a document. + * @throws {RangeError} fieldName cannot contain unsupported characters '/' + */ +lunr.Builder.prototype.field = function (fieldName, attributes) { + if (/\//.test(fieldName)) { + throw new RangeError ("Field '" + fieldName + "' contains illegal character '/'") + } + + this._fields[fieldName] = attributes || {} +} + +/** + * A parameter to tune the amount of field length normalisation that is applied when + * calculating relevance scores. A value of 0 will completely disable any normalisation + * and a value of 1 will fully normalise field lengths. The default is 0.75. Values of b + * will be clamped to the range 0 - 1. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.b = function (number) { + if (number < 0) { + this._b = 0 + } else if (number > 1) { + this._b = 1 + } else { + this._b = number + } +} + +/** + * A parameter that controls the speed at which a rise in term frequency results in term + * frequency saturation. The default value is 1.2. Setting this to a higher value will give + * slower saturation levels, a lower value will result in quicker saturation. + * + * @param {number} number - The value to set for this tuning parameter. + */ +lunr.Builder.prototype.k1 = function (number) { + this._k1 = number +} + +/** + * Adds a document to the index. + * + * Before adding fields to the index the index should have been fully setup, with the document + * ref and all fields to index already having been specified. + * + * The document must have a field name as specified by the ref (by default this is 'id') and + * it should have all fields defined for indexing, though null or undefined values will not + * cause errors. + * + * Entire documents can be boosted at build time. Applying a boost to a document indicates that + * this document should rank higher in search results than other documents. + * + * @param {object} doc - The document to add to the index. + * @param {object} attributes - Optional attributes associated with this document. + * @param {number} [attributes.boost=1] - Boost applied to all terms within this document. + */ +lunr.Builder.prototype.add = function (doc, attributes) { + var docRef = doc[this._ref], + fields = Object.keys(this._fields) + + this._documents[docRef] = attributes || {} + this.documentCount += 1 + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i], + extractor = this._fields[fieldName].extractor, + field = extractor ? extractor(doc) : doc[fieldName], + tokens = this.tokenizer(field, { + fields: [fieldName] + }), + terms = this.pipeline.run(tokens), + fieldRef = new lunr.FieldRef (docRef, fieldName), + fieldTerms = Object.create(null) + + this.fieldTermFrequencies[fieldRef] = fieldTerms + this.fieldLengths[fieldRef] = 0 + + // store the length of this field for this document + this.fieldLengths[fieldRef] += terms.length + + // calculate term frequencies for this field + for (var j = 0; j < terms.length; j++) { + var term = terms[j] + + if (fieldTerms[term] == undefined) { + fieldTerms[term] = 0 + } + + fieldTerms[term] += 1 + + // add to inverted index + // create an initial posting if one doesn't exist + if (this.invertedIndex[term] == undefined) { + var posting = Object.create(null) + posting["_index"] = this.termIndex + this.termIndex += 1 + + for (var k = 0; k < fields.length; k++) { + posting[fields[k]] = Object.create(null) + } + + this.invertedIndex[term] = posting + } + + // add an entry for this term/fieldName/docRef to the invertedIndex + if (this.invertedIndex[term][fieldName][docRef] == undefined) { + this.invertedIndex[term][fieldName][docRef] = Object.create(null) + } + + // store all whitelisted metadata about this token in the + // inverted index + for (var l = 0; l < this.metadataWhitelist.length; l++) { + var metadataKey = this.metadataWhitelist[l], + metadata = term.metadata[metadataKey] + + if (this.invertedIndex[term][fieldName][docRef][metadataKey] == undefined) { + this.invertedIndex[term][fieldName][docRef][metadataKey] = [] + } + + this.invertedIndex[term][fieldName][docRef][metadataKey].push(metadata) + } + } + + } +} + +/** + * Calculates the average document length for this index + * + * @private + */ +lunr.Builder.prototype.calculateAverageFieldLengths = function () { + + var fieldRefs = Object.keys(this.fieldLengths), + numberOfFields = fieldRefs.length, + accumulator = {}, + documentsWithField = {} + + for (var i = 0; i < numberOfFields; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + field = fieldRef.fieldName + + documentsWithField[field] || (documentsWithField[field] = 0) + documentsWithField[field] += 1 + + accumulator[field] || (accumulator[field] = 0) + accumulator[field] += this.fieldLengths[fieldRef] + } + + var fields = Object.keys(this._fields) + + for (var i = 0; i < fields.length; i++) { + var fieldName = fields[i] + accumulator[fieldName] = accumulator[fieldName] / documentsWithField[fieldName] + } + + this.averageFieldLength = accumulator +} + +/** + * Builds a vector space model of every document using lunr.Vector + * + * @private + */ +lunr.Builder.prototype.createFieldVectors = function () { + var fieldVectors = {}, + fieldRefs = Object.keys(this.fieldTermFrequencies), + fieldRefsLength = fieldRefs.length, + termIdfCache = Object.create(null) + + for (var i = 0; i < fieldRefsLength; i++) { + var fieldRef = lunr.FieldRef.fromString(fieldRefs[i]), + fieldName = fieldRef.fieldName, + fieldLength = this.fieldLengths[fieldRef], + fieldVector = new lunr.Vector, + termFrequencies = this.fieldTermFrequencies[fieldRef], + terms = Object.keys(termFrequencies), + termsLength = terms.length + + + var fieldBoost = this._fields[fieldName].boost || 1, + docBoost = this._documents[fieldRef.docRef].boost || 1 + + for (var j = 0; j < termsLength; j++) { + var term = terms[j], + tf = termFrequencies[term], + termIndex = this.invertedIndex[term]._index, + idf, score, scoreWithPrecision + + if (termIdfCache[term] === undefined) { + idf = lunr.idf(this.invertedIndex[term], this.documentCount) + termIdfCache[term] = idf + } else { + idf = termIdfCache[term] + } + + score = idf * ((this._k1 + 1) * tf) / (this._k1 * (1 - this._b + this._b * (fieldLength / this.averageFieldLength[fieldName])) + tf) + score *= fieldBoost + score *= docBoost + scoreWithPrecision = Math.round(score * 1000) / 1000 + // Converts 1.23456789 to 1.234. + // Reducing the precision so that the vectors take up less + // space when serialised. Doing it now so that they behave + // the same before and after serialisation. Also, this is + // the fastest approach to reducing a number's precision in + // JavaScript. + + fieldVector.insert(termIndex, scoreWithPrecision) + } + + fieldVectors[fieldRef] = fieldVector + } + + this.fieldVectors = fieldVectors +} + +/** + * Creates a token set of all tokens in the index using lunr.TokenSet + * + * @private + */ +lunr.Builder.prototype.createTokenSet = function () { + this.tokenSet = lunr.TokenSet.fromArray( + Object.keys(this.invertedIndex).sort() + ) +} + +/** + * Builds the index, creating an instance of lunr.Index. + * + * This completes the indexing process and should only be called + * once all documents have been added to the index. + * + * @returns {lunr.Index} + */ +lunr.Builder.prototype.build = function () { + this.calculateAverageFieldLengths() + this.createFieldVectors() + this.createTokenSet() + + return new lunr.Index({ + invertedIndex: this.invertedIndex, + fieldVectors: this.fieldVectors, + tokenSet: this.tokenSet, + fields: Object.keys(this._fields), + pipeline: this.searchPipeline + }) +} + +/** + * Applies a plugin to the index builder. + * + * A plugin is a function that is called with the index builder as its context. + * Plugins can be used to customise or extend the behaviour of the index + * in some way. A plugin is just a function, that encapsulated the custom + * behaviour that should be applied when building the index. + * + * The plugin function will be called with the index builder as its argument, additional + * arguments can also be passed when calling use. The function will be called + * with the index builder as its context. + * + * @param {Function} plugin The plugin to apply. + */ +lunr.Builder.prototype.use = function (fn) { + var args = Array.prototype.slice.call(arguments, 1) + args.unshift(this) + fn.apply(this, args) +} +/** + * Contains and collects metadata about a matching document. + * A single instance of lunr.MatchData is returned as part of every + * lunr.Index~Result. + * + * @constructor + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + * @property {object} metadata - A cloned collection of metadata associated with this document. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData = function (term, field, metadata) { + var clonedMetadata = Object.create(null), + metadataKeys = Object.keys(metadata || {}) + + // Cloning the metadata to prevent the original + // being mutated during match data combination. + // Metadata is kept in an array within the inverted + // index so cloning the data can be done with + // Array#slice + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + clonedMetadata[key] = metadata[key].slice() + } + + this.metadata = Object.create(null) + + if (term !== undefined) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = clonedMetadata + } +} + +/** + * An instance of lunr.MatchData will be created for every term that matches a + * document. However only one instance is required in a lunr.Index~Result. This + * method combines metadata from another instance of lunr.MatchData with this + * objects metadata. + * + * @param {lunr.MatchData} otherMatchData - Another instance of match data to merge with this one. + * @see {@link lunr.Index~Result} + */ +lunr.MatchData.prototype.combine = function (otherMatchData) { + var terms = Object.keys(otherMatchData.metadata) + + for (var i = 0; i < terms.length; i++) { + var term = terms[i], + fields = Object.keys(otherMatchData.metadata[term]) + + if (this.metadata[term] == undefined) { + this.metadata[term] = Object.create(null) + } + + for (var j = 0; j < fields.length; j++) { + var field = fields[j], + keys = Object.keys(otherMatchData.metadata[term][field]) + + if (this.metadata[term][field] == undefined) { + this.metadata[term][field] = Object.create(null) + } + + for (var k = 0; k < keys.length; k++) { + var key = keys[k] + + if (this.metadata[term][field][key] == undefined) { + this.metadata[term][field][key] = otherMatchData.metadata[term][field][key] + } else { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(otherMatchData.metadata[term][field][key]) + } + + } + } + } +} + +/** + * Add metadata for a term/field pair to this instance of match data. + * + * @param {string} term - The term this match data is associated with + * @param {string} field - The field in which the term was found + * @param {object} metadata - The metadata recorded about this term in this field + */ +lunr.MatchData.prototype.add = function (term, field, metadata) { + if (!(term in this.metadata)) { + this.metadata[term] = Object.create(null) + this.metadata[term][field] = metadata + return + } + + if (!(field in this.metadata[term])) { + this.metadata[term][field] = metadata + return + } + + var metadataKeys = Object.keys(metadata) + + for (var i = 0; i < metadataKeys.length; i++) { + var key = metadataKeys[i] + + if (key in this.metadata[term][field]) { + this.metadata[term][field][key] = this.metadata[term][field][key].concat(metadata[key]) + } else { + this.metadata[term][field][key] = metadata[key] + } + } +} +/** + * A lunr.Query provides a programmatic way of defining queries to be performed + * against a {@link lunr.Index}. + * + * Prefer constructing a lunr.Query using the {@link lunr.Index#query} method + * so the query object is pre-initialized with the right index fields. + * + * @constructor + * @property {lunr.Query~Clause[]} clauses - An array of query clauses. + * @property {string[]} allFields - An array of all available fields in a lunr.Index. + */ +lunr.Query = function (allFields) { + this.clauses = [] + this.allFields = allFields +} + +/** + * Constants for indicating what kind of automatic wildcard insertion will be used when constructing a query clause. + * + * This allows wildcards to be added to the beginning and end of a term without having to manually do any string + * concatenation. + * + * The wildcard constants can be bitwise combined to select both leading and trailing wildcards. + * + * @constant + * @default + * @property {number} wildcard.NONE - The term will have no wildcards inserted, this is the default behaviour + * @property {number} wildcard.LEADING - Prepend the term with a wildcard, unless a leading wildcard already exists + * @property {number} wildcard.TRAILING - Append a wildcard to the term, unless a trailing wildcard already exists + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with trailing wildcard + * query.term('foo', { wildcard: lunr.Query.wildcard.TRAILING }) + * @example query term with leading and trailing wildcard + * query.term('foo', { + * wildcard: lunr.Query.wildcard.LEADING | lunr.Query.wildcard.TRAILING + * }) + */ + +lunr.Query.wildcard = new String ("*") +lunr.Query.wildcard.NONE = 0 +lunr.Query.wildcard.LEADING = 1 +lunr.Query.wildcard.TRAILING = 2 + +/** + * Constants for indicating what kind of presence a term must have in matching documents. + * + * @constant + * @enum {number} + * @see lunr.Query~Clause + * @see lunr.Query#clause + * @see lunr.Query#term + * @example query term with required presence + * query.term('foo', { presence: lunr.Query.presence.REQUIRED }) + */ +lunr.Query.presence = { + /** + * Term's presence in a document is optional, this is the default value. + */ + OPTIONAL: 1, + + /** + * Term's presence in a document is required, documents that do not contain + * this term will not be returned. + */ + REQUIRED: 2, + + /** + * Term's presence in a document is prohibited, documents that do contain + * this term will not be returned. + */ + PROHIBITED: 3 +} + +/** + * A single clause in a {@link lunr.Query} contains a term and details on how to + * match that term against a {@link lunr.Index}. + * + * @typedef {Object} lunr.Query~Clause + * @property {string[]} fields - The fields in an index this clause should be matched against. + * @property {number} [boost=1] - Any boost that should be applied when matching this clause. + * @property {number} [editDistance] - Whether the term should have fuzzy matching applied, and how fuzzy the match should be. + * @property {boolean} [usePipeline] - Whether the term should be passed through the search pipeline. + * @property {number} [wildcard=lunr.Query.wildcard.NONE] - Whether the term should have wildcards appended or prepended. + * @property {number} [presence=lunr.Query.presence.OPTIONAL] - The terms presence in any matching documents. + */ + +/** + * Adds a {@link lunr.Query~Clause} to this query. + * + * Unless the clause contains the fields to be matched all fields will be matched. In addition + * a default boost of 1 is applied to the clause. + * + * @param {lunr.Query~Clause} clause - The clause to add to this query. + * @see lunr.Query~Clause + * @returns {lunr.Query} + */ +lunr.Query.prototype.clause = function (clause) { + if (!('fields' in clause)) { + clause.fields = this.allFields + } + + if (!('boost' in clause)) { + clause.boost = 1 + } + + if (!('usePipeline' in clause)) { + clause.usePipeline = true + } + + if (!('wildcard' in clause)) { + clause.wildcard = lunr.Query.wildcard.NONE + } + + if ((clause.wildcard & lunr.Query.wildcard.LEADING) && (clause.term.charAt(0) != lunr.Query.wildcard)) { + clause.term = "*" + clause.term + } + + if ((clause.wildcard & lunr.Query.wildcard.TRAILING) && (clause.term.slice(-1) != lunr.Query.wildcard)) { + clause.term = "" + clause.term + "*" + } + + if (!('presence' in clause)) { + clause.presence = lunr.Query.presence.OPTIONAL + } + + this.clauses.push(clause) + + return this +} + +/** + * A negated query is one in which every clause has a presence of + * prohibited. These queries require some special processing to return + * the expected results. + * + * @returns boolean + */ +lunr.Query.prototype.isNegated = function () { + for (var i = 0; i < this.clauses.length; i++) { + if (this.clauses[i].presence != lunr.Query.presence.PROHIBITED) { + return false + } + } + + return true +} + +/** + * Adds a term to the current query, under the covers this will create a {@link lunr.Query~Clause} + * to the list of clauses that make up this query. + * + * The term is used as is, i.e. no tokenization will be performed by this method. Instead conversion + * to a token or token-like string should be done before calling this method. + * + * The term will be converted to a string by calling `toString`. Multiple terms can be passed as an + * array, each term in the array will share the same options. + * + * @param {object|object[]} term - The term(s) to add to the query. + * @param {object} [options] - Any additional properties to add to the query clause. + * @returns {lunr.Query} + * @see lunr.Query#clause + * @see lunr.Query~Clause + * @example adding a single term to a query + * query.term("foo") + * @example adding a single term to a query and specifying search fields, term boost and automatic trailing wildcard + * query.term("foo", { + * fields: ["title"], + * boost: 10, + * wildcard: lunr.Query.wildcard.TRAILING + * }) + * @example using lunr.tokenizer to convert a string to tokens before using them as terms + * query.term(lunr.tokenizer("foo bar")) + */ +lunr.Query.prototype.term = function (term, options) { + if (Array.isArray(term)) { + term.forEach(function (t) { this.term(t, lunr.utils.clone(options)) }, this) + return this + } + + var clause = options || {} + clause.term = term.toString() + + this.clause(clause) + + return this +} +lunr.QueryParseError = function (message, start, end) { + this.name = "QueryParseError" + this.message = message + this.start = start + this.end = end +} + +lunr.QueryParseError.prototype = new Error +lunr.QueryLexer = function (str) { + this.lexemes = [] + this.str = str + this.length = str.length + this.pos = 0 + this.start = 0 + this.escapeCharPositions = [] +} + +lunr.QueryLexer.prototype.run = function () { + var state = lunr.QueryLexer.lexText + + while (state) { + state = state(this) + } +} + +lunr.QueryLexer.prototype.sliceString = function () { + var subSlices = [], + sliceStart = this.start, + sliceEnd = this.pos + + for (var i = 0; i < this.escapeCharPositions.length; i++) { + sliceEnd = this.escapeCharPositions[i] + subSlices.push(this.str.slice(sliceStart, sliceEnd)) + sliceStart = sliceEnd + 1 + } + + subSlices.push(this.str.slice(sliceStart, this.pos)) + this.escapeCharPositions.length = 0 + + return subSlices.join('') +} + +lunr.QueryLexer.prototype.emit = function (type) { + this.lexemes.push({ + type: type, + str: this.sliceString(), + start: this.start, + end: this.pos + }) + + this.start = this.pos +} + +lunr.QueryLexer.prototype.escapeCharacter = function () { + this.escapeCharPositions.push(this.pos - 1) + this.pos += 1 +} + +lunr.QueryLexer.prototype.next = function () { + if (this.pos >= this.length) { + return lunr.QueryLexer.EOS + } + + var char = this.str.charAt(this.pos) + this.pos += 1 + return char +} + +lunr.QueryLexer.prototype.width = function () { + return this.pos - this.start +} + +lunr.QueryLexer.prototype.ignore = function () { + if (this.start == this.pos) { + this.pos += 1 + } + + this.start = this.pos +} + +lunr.QueryLexer.prototype.backup = function () { + this.pos -= 1 +} + +lunr.QueryLexer.prototype.acceptDigitRun = function () { + var char, charCode + + do { + char = this.next() + charCode = char.charCodeAt(0) + } while (charCode > 47 && charCode < 58) + + if (char != lunr.QueryLexer.EOS) { + this.backup() + } +} + +lunr.QueryLexer.prototype.more = function () { + return this.pos < this.length +} + +lunr.QueryLexer.EOS = 'EOS' +lunr.QueryLexer.FIELD = 'FIELD' +lunr.QueryLexer.TERM = 'TERM' +lunr.QueryLexer.EDIT_DISTANCE = 'EDIT_DISTANCE' +lunr.QueryLexer.BOOST = 'BOOST' +lunr.QueryLexer.PRESENCE = 'PRESENCE' + +lunr.QueryLexer.lexField = function (lexer) { + lexer.backup() + lexer.emit(lunr.QueryLexer.FIELD) + lexer.ignore() + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexTerm = function (lexer) { + if (lexer.width() > 1) { + lexer.backup() + lexer.emit(lunr.QueryLexer.TERM) + } + + lexer.ignore() + + if (lexer.more()) { + return lunr.QueryLexer.lexText + } +} + +lunr.QueryLexer.lexEditDistance = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.EDIT_DISTANCE) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexBoost = function (lexer) { + lexer.ignore() + lexer.acceptDigitRun() + lexer.emit(lunr.QueryLexer.BOOST) + return lunr.QueryLexer.lexText +} + +lunr.QueryLexer.lexEOS = function (lexer) { + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } +} + +// This matches the separator used when tokenising fields +// within a document. These should match otherwise it is +// not possible to search for some tokens within a document. +// +// It is possible for the user to change the separator on the +// tokenizer so it _might_ clash with any other of the special +// characters already used within the search string, e.g. :. +// +// This means that it is possible to change the separator in +// such a way that makes some words unsearchable using a search +// string. +lunr.QueryLexer.termSeparator = lunr.tokenizer.separator + +lunr.QueryLexer.lexText = function (lexer) { + while (true) { + var char = lexer.next() + + if (char == lunr.QueryLexer.EOS) { + return lunr.QueryLexer.lexEOS + } + + // Escape character is '\' + if (char.charCodeAt(0) == 92) { + lexer.escapeCharacter() + continue + } + + if (char == ":") { + return lunr.QueryLexer.lexField + } + + if (char == "~") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexEditDistance + } + + if (char == "^") { + lexer.backup() + if (lexer.width() > 0) { + lexer.emit(lunr.QueryLexer.TERM) + } + return lunr.QueryLexer.lexBoost + } + + // "+" indicates term presence is required + // checking for length to ensure that only + // leading "+" are considered + if (char == "+" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + // "-" indicates term presence is prohibited + // checking for length to ensure that only + // leading "-" are considered + if (char == "-" && lexer.width() === 1) { + lexer.emit(lunr.QueryLexer.PRESENCE) + return lunr.QueryLexer.lexText + } + + if (char.match(lunr.QueryLexer.termSeparator)) { + return lunr.QueryLexer.lexTerm + } + } +} + +lunr.QueryParser = function (str, query) { + this.lexer = new lunr.QueryLexer (str) + this.query = query + this.currentClause = {} + this.lexemeIdx = 0 +} + +lunr.QueryParser.prototype.parse = function () { + this.lexer.run() + this.lexemes = this.lexer.lexemes + + var state = lunr.QueryParser.parseClause + + while (state) { + state = state(this) + } + + return this.query +} + +lunr.QueryParser.prototype.peekLexeme = function () { + return this.lexemes[this.lexemeIdx] +} + +lunr.QueryParser.prototype.consumeLexeme = function () { + var lexeme = this.peekLexeme() + this.lexemeIdx += 1 + return lexeme +} + +lunr.QueryParser.prototype.nextClause = function () { + var completedClause = this.currentClause + this.query.clause(completedClause) + this.currentClause = {} +} + +lunr.QueryParser.parseClause = function (parser) { + var lexeme = parser.peekLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.type) { + case lunr.QueryLexer.PRESENCE: + return lunr.QueryParser.parsePresence + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expected either a field or a term, found " + lexeme.type + + if (lexeme.str.length >= 1) { + errorMessage += " with value '" + lexeme.str + "'" + } + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } +} + +lunr.QueryParser.parsePresence = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + switch (lexeme.str) { + case "-": + parser.currentClause.presence = lunr.Query.presence.PROHIBITED + break + case "+": + parser.currentClause.presence = lunr.Query.presence.REQUIRED + break + default: + var errorMessage = "unrecognised presence operator'" + lexeme.str + "'" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term or field, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.FIELD: + return lunr.QueryParser.parseField + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term or field, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseField = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + if (parser.query.allFields.indexOf(lexeme.str) == -1) { + var possibleFields = parser.query.allFields.map(function (f) { return "'" + f + "'" }).join(', '), + errorMessage = "unrecognised field '" + lexeme.str + "', possible fields: " + possibleFields + + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.fields = [lexeme.str] + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + var errorMessage = "expecting term, found nothing" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + return lunr.QueryParser.parseTerm + default: + var errorMessage = "expecting term, found '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseTerm = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + parser.currentClause.term = lexeme.str.toLowerCase() + + if (lexeme.str.indexOf("*") != -1) { + parser.currentClause.usePipeline = false + } + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseEditDistance = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var editDistance = parseInt(lexeme.str, 10) + + if (isNaN(editDistance)) { + var errorMessage = "edit distance must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.editDistance = editDistance + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + +lunr.QueryParser.parseBoost = function (parser) { + var lexeme = parser.consumeLexeme() + + if (lexeme == undefined) { + return + } + + var boost = parseInt(lexeme.str, 10) + + if (isNaN(boost)) { + var errorMessage = "boost must be numeric" + throw new lunr.QueryParseError (errorMessage, lexeme.start, lexeme.end) + } + + parser.currentClause.boost = boost + + var nextLexeme = parser.peekLexeme() + + if (nextLexeme == undefined) { + parser.nextClause() + return + } + + switch (nextLexeme.type) { + case lunr.QueryLexer.TERM: + parser.nextClause() + return lunr.QueryParser.parseTerm + case lunr.QueryLexer.FIELD: + parser.nextClause() + return lunr.QueryParser.parseField + case lunr.QueryLexer.EDIT_DISTANCE: + return lunr.QueryParser.parseEditDistance + case lunr.QueryLexer.BOOST: + return lunr.QueryParser.parseBoost + case lunr.QueryLexer.PRESENCE: + parser.nextClause() + return lunr.QueryParser.parsePresence + default: + var errorMessage = "Unexpected lexeme type '" + nextLexeme.type + "'" + throw new lunr.QueryParseError (errorMessage, nextLexeme.start, nextLexeme.end) + } +} + + /** + * export the module via AMD, CommonJS or as a browser global + * Export code from https://github.com/umdjs/umd/blob/master/returnExports.js + */ + ;(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(factory) + } else if (typeof exports === 'object') { + /** + * Node. Does not work with strict CommonJS, but + * only CommonJS-like environments that support module.exports, + * like Node. + */ + module.exports = factory() + } else { + // Browser globals (root is window) + root.lunr = factory() + } + }(this, function () { + /** + * Just return a value to define the module export. + * This example returns an object, but the module + * can return a function as the exported value. + */ + return lunr + })) +})(); diff --git a/search/main.js b/search/main.js new file mode 100644 index 00000000..a5e469d7 --- /dev/null +++ b/search/main.js @@ -0,0 +1,109 @@ +function getSearchTermFromLocation() { + var sPageURL = window.location.search.substring(1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == 'q') { + return decodeURIComponent(sParameterName[1].replace(/\+/g, '%20')); + } + } +} + +function joinUrl (base, path) { + if (path.substring(0, 1) === "/") { + // path starts with `/`. Thus it is absolute. + return path; + } + if (base.substring(base.length-1) === "/") { + // base ends with `/` + return base + path; + } + return base + "/" + path; +} + +function escapeHtml (value) { + return value.replace(/&/g, '&') + .replace(/"/g, '"') + .replace(//g, '>'); +} + +function formatResult (location, title, summary) { + return ''; +} + +function displayResults (results) { + var search_results = document.getElementById("mkdocs-search-results"); + while (search_results.firstChild) { + search_results.removeChild(search_results.firstChild); + } + if (results.length > 0){ + for (var i=0; i < results.length; i++){ + var result = results[i]; + var html = formatResult(result.location, result.title, result.summary); + search_results.insertAdjacentHTML('beforeend', html); + } + } else { + var noResultsText = search_results.getAttribute('data-no-results-text'); + if (!noResultsText) { + noResultsText = "No results found"; + } + search_results.insertAdjacentHTML('beforeend', '

' + noResultsText + '

'); + } +} + +function doSearch () { + var query = document.getElementById('mkdocs-search-query').value; + if (query.length > min_search_length) { + if (!window.Worker) { + displayResults(search(query)); + } else { + searchWorker.postMessage({query: query}); + } + } else { + // Clear results for short queries + displayResults([]); + } +} + +function initSearch () { + var search_input = document.getElementById('mkdocs-search-query'); + if (search_input) { + search_input.addEventListener("keyup", doSearch); + } + var term = getSearchTermFromLocation(); + if (term) { + search_input.value = term; + doSearch(); + } +} + +function onWorkerMessage (e) { + if (e.data.allowSearch) { + initSearch(); + } else if (e.data.results) { + var results = e.data.results; + displayResults(results); + } else if (e.data.config) { + min_search_length = e.data.config.min_search_length-1; + } +} + +if (!window.Worker) { + console.log('Web Worker API not supported'); + // load index in main thread + $.getScript(joinUrl(base_url, "search/worker.js")).done(function () { + console.log('Loaded worker'); + init(); + window.postMessage = function (msg) { + onWorkerMessage({data: msg}); + }; + }).fail(function (jqxhr, settings, exception) { + console.error('Could not load worker.js'); + }); +} else { + // Wrap search in a web worker + var searchWorker = new Worker(joinUrl(base_url, "search/worker.js")); + searchWorker.postMessage({init: true}); + searchWorker.onmessage = onWorkerMessage; +} diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 00000000..6d8e208e --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"Koswat \u00b6 Official documentation read the docs for Koswat","title":"Koswat"},{"location":"index.html#koswat","text":"Official documentation read the docs for Koswat","title":"Koswat"},{"location":"changelog.html","text":"Release-2023 (2023-11-07) \u00b6 Feat \u00b6 Added order_strategy submodule for determining reinforcement features across a dike traject based on default order Added new class to better handle / generate the location-reinforcement matrix Fix \u00b6 improve rounding improve rounding improve rounding show cost per km if no locations present add @property to total_cost add @property to total_cost add @property to total_cost test on presence of construction costs correct return type Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString corrected berm width calculations (#114) corrected berm width calculations merge leftovers rename \"raise\" to \"surtax\" throughout KOSWAT rename \"raise\" to \"surtax\" throughout KOSWAT correct symbol name correct symbol name typo comment typo comment Added logic to avoid creating added / removed layers geometries when there were no modifications Added default values as math.nan for koswatscenario We now replace not-provided values from a KoswatScenario when calculating new reinforcements docu corrections docu corrections docu corrections v0.14.1 (2023-11-08) \u00b6 v0.14.0 (2023-11-07) \u00b6 Feat \u00b6 Added order_strategy submodule for determining reinforcement features across a dike traject based on default order Added new class to better handle / generate the location-reinforcement matrix Fix \u00b6 improve rounding improve rounding improve rounding show cost per km if no locations present add @property to total_cost add @property to total_cost add @property to total_cost test on presence of construction costs correct return type Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString corrected berm width calculations (#114) corrected berm width calculations merge leftovers rename \"raise\" to \"surtax\" throughout KOSWAT rename \"raise\" to \"surtax\" throughout KOSWAT correct symbol name correct symbol name typo comment typo comment Added logic to avoid creating added / removed layers geometries when there were no modifications Added default values as math.nan for koswatscenario We now replace not-provided values from a KoswatScenario when calculating new reinforcements docu corrections docu corrections docu corrections v0.13.0 (2023-01-31) \u00b6 Feat \u00b6 volume_cost_parameters_builder.py : We now calculate the costs based on the ini input file v0.12.1 (2023-01-27) \u00b6 Fix \u00b6 calc_library.py : Standrad reinforcement calculation now uses a different method to make sure the added geometry is normalized v0.12.0 (2023-01-26) \u00b6 Feat \u00b6 koswat/cost_report : Koswat Summary now includes all available locations even if they are not suitable for any reinforcement profile. Adapted the rest of the classes to generate a proper matrix also during export v0.11.7 (2023-01-25) \u00b6 Fix \u00b6 calc_library.py : We now check whether the last point intersects with the line drawn between the first two points to avoid precission issues v0.11.6 (2023-01-25) \u00b6 Fix \u00b6 calc_library.py;koswat_coating_layer_builder.py : We now round up the coordinates of the calculated layers to avoid precision issues calc_library.py : Corrected collection of surface points, added extra plot for reinforced profiles v0.11.5 (2023-01-12) \u00b6 Fix \u00b6 calc_library : Small correction to avoid crashing when trying to order multiline strings v0.11.4 (2023-01-12) \u00b6 Fix \u00b6 standard_reinforcement_layers_wrapper_builder : Fixed sand layer added surface not being correct calc_library.py : After doing a geometry union the resulting geometry gets now their points in order v0.11.3 (2023-01-12) \u00b6 Fix \u00b6 koswat/configuration : Fixed creation of scenarios based on selected dike sections v0.11.2 (2022-12-21) \u00b6 v0.11.1 (2022-12-20) \u00b6 Fix \u00b6 koswat/ main .py : Renamed main file to fit to python main expected module v0.11.0 (2022-12-20) \u00b6 Feat \u00b6 koswat/koswat_handler.py : We now accept a log_output argument to specify the directory where to save the koswat run log. v0.10.0 (2022-12-20) \u00b6 Feat \u00b6 koswat/configuration/converters : Created converters fom to dom koswat/configuration/io/converters/ : Added configuration converters for the analysis section. We can now generate input profiles from the ini files koswat/configuration/io/csv : Added import of KoswatInputProfiles KoswatHandler;KoswatLogger : Added handler and logger for koswat runs from CLI Fix \u00b6 koswat/geometries/calc_library.py : We now order the points of the geometries so that calculations can be done correctly koswat/calculations : Corrected profile calculation for all types and their tests. These changes come directly from Peter de Grave koswat/configuration/io/koswat_run_settings_importer.py : corrected filtering of selected input profiles koswat_dike_locations_shp_reader.py : Fixed enumerating a filtered list instead of filtering after enumerating KoswatSurroundingsConverter : Fixed return as it was only giving the latest mapped FOM configuration/io/converters : Fixed return of data and adapted tests koswat_analysis_converter.py : Small fix to converter koswat_General_settings.py : Fix validation for surroundings koswat/calculations : Fixed calculations due to new profile input property KoswatMaterialType : Minor fix regarding usage of new KoswatMaterialType KoswatMaterialType : Adapted code to use the enum instead of strings Refactor \u00b6 koswat/configuration/io : Moved converters into io koswat/dike/surroundings/io/shp : Moved shp reader and fom to surroundings module koswat/configuration : Integrating mapping of files to fom's during settings import koswat/dike/surroundings/io : Moved previous CSV reader into a concrete module within dike/surroundings. Created protocols for csv reading so it can be repurposed KoswatMaterialType : Made koswat material into an enum. Adapted code overall in the source v0.9.0 (2022-12-12) \u00b6 Feat \u00b6 KoswatGeneralSettings : Created DOM for koswat general settings configuration KoswatConfigurationIniImporter : We can now map all different ini fom classes to the config class koswat/configuration : Created koswat configuration module and related class KoswatConfiguration to encapsulate all require information for a koswat analysis KoswatScenarioIniFom : It is now possible to read a KoswatScenarioIniFom from file KoswatDikeSelectionIniFom : It is now possible to read a Dike Selection INI file into its corresponding FOM KoswatCostsIniFom : Added logic to fully implement reading of a KoswatCostsIniFom file KoswatCostsIniFom : Added koswat costs ini file KoswatIniReader : Created koswat ini reader and initial approach to reading the general Koswat INI file Fix \u00b6 KoswatCosts : Added class conversion to dictionary Refactor \u00b6 koswat/configuration/models : Moved configuration data object models into their own module. Fixed / grouped imports KoswatDikeSelection : Koswat dike selection now implements a new type KoswatDikeSelectionTxtFom with related reader koswat_scenario : Moved koswat scenario into koswat/configuration koswat/io : Adapted export / import fom protocol v0.8.2 (2022-12-09) \u00b6 Fix \u00b6 KoswatLayerProtocol : we now have two different geometries for a layer, so that the profile with the layer and the stand alone representation of it are better reached v0.8.1 (2022-11-21) \u00b6 Fix \u00b6 SummaryMatrixCsvExporter : We now provide NANs when volume parameter is not defined summary_matrix_csv_exporter : We now correctly export all required information to the csv for the user v0.8.0 (2022-11-19) \u00b6 Feat \u00b6 KoswatPlotContext : Created plot context handler so it's easier to initialize and close plots v0.7.0 (2022-11-18) \u00b6 Feat \u00b6 koswat/cost_report/io/plots/ : Added module for cost_report export plots logic koswat_profile_plot.py : We can now set a unique color for layers_wrapper and profile plots koswat/plots/dike/ : Extracted dike plotting logic into separate classes koswat/plots/geometries : Created module with plotting for regular geometries from shapely Fix \u00b6 koswat/plots/utils.py : Replaced wrapper as it is not a good approach characteristic_points_builder.py : Resolved a circular dependency Refactor \u00b6 koswat/calculations/io/ : Extracted plot exporters from calculations into their corresponding directory koswat/plots : Create concrete module for plotting koswat/io : Moved io files into their corresponding modules v0.6.0 (2022-11-11) \u00b6 Feat \u00b6 VolumeCalculationParameters : Included all operations required to for volume calculation ReinforcementProfileProtocol : Added new property to retrieve the new ground level surface OutsideSlopeReinforcementLayersWrapperBuilder : Added builder for for the outside slope reinforcement layers wrapper StandardReinforcemetnLayersWrapperBuilder : Added logic to generate the geometries of a standard reinforcement dike ReinforcementLayersWrapper : We now have dedicated builders for the LayersWrapper associated with a Reinforcement ReinforcementProfileBuilderProtocol : Created protocol for better hierarchy CoatingLayerCostReport : Extended usage of previous StandardLayerCostReport so that other reinforcements can also use it Added logic to extract the surface of a layer LayerCostReportProtocol;StandardLayerCostReportBuilder : Extracted standard layer cost report builder logic into separate class. Added protocol to represent the layer cost reports koswat/geometries; standard_layer_cost_report : Implemented logic for StandardLayer cost calculation OutsideSlopeReinforcementProfileProtocol;StandardReinforcementProfileProtocol : Added protocols to represent the different types of reinforcement - per volume; Added tests for factory LayerCostReportbuilderFactory : Added logic to retrieve the corresponding LayerCostReportBuilderProtocol; Adapted tests and related imports LayerCostReportBuilderFactory : Introduced layer cost report builder factory for the different types of volume calculators available Fix \u00b6 PipingWallReinforcementProfileCalculation : Solved wrong calculation of the Length Piping Wall StabilityWallReinforcementProfileCalculation : Corrected calculation of the length stability wall property StabilityWall calculation was not properly mapped OutsideSlopeProfileCostReportBuilder : Now we properly calculate the added core layer OutsideSlopeProfileCostReportBuilder : Calculation of the 'kistdam' layers is now done properly Refactor \u00b6 koswat/calculations : Moved calculations into their respecitve reinforcement types Starting to move logic of added / removed layers to the calculation module cost_report : Moved layer factory to profile factory as the logic should be in a higher level v0.5.1 (2022-10-11) \u00b6 Fix \u00b6 SummaryMatrixCsvExporter : We now export the locations in order of import v0.5.0 (2022-10-11) \u00b6 Feat \u00b6 SummaryMatrixCsvExporter : We now also export the CsvFom into a file SummaryMatrixCsvFom;SummaryMatrixCsvExporter : Added Summary Matrix Csv Fom and Exporter initial logic CofferDamInputProfile : Added concrete input profile for CofferDamReinforcementProfile calculations/cofferdam;CofferdamReinforcementProfileCalculation;CofferdamReinforcementProfile : Added Cofferdam Reinforcement Profile and Calculation to the calculations module. Added information to the summary to also build their report. StabilityWallInputProfile;StabilityWallReinforcementProfileCalculation : Created both concrete input profile and profile calculation for StabilityWallReinforcementProfile StabilityWallReinforcemetnProfile : Added StabilityWallReinforcementProfile type PipingWallInputProfile : Created dedicated input profile for PipingWall KoswatInputProfileProtocol : Made a Koswat Input Profile protocol to manage better concrete input profiles. Adapted existing code and tests PipingWallReinforcementProfileCalculation : Added calculation for PipingWall Reinforcement Profile PipingWall : Added PipingWallReinforcementProfile class ReinforcementProfileProtocol : Introduced ReinforcementProfileProtocol as a sub protocol of KoswatProfileProtocol. Adapted existent classes and tests. Moved existing calculations into calculations\\soil Fix \u00b6 CofferdamReinforcementProfileCalculation : P4 x coordinate set to 0 for all builds from this calculation KoswatProfileBuilder : Removed paramater from build method to make it complier to the BuilderProtocol v0.4.0 (2022-10-07) \u00b6 Feat \u00b6 MultiLocationMultiProfileCostBuilder : Added new report to summarize reports of profile per location. ListMultiLocationProfileCostBuilder : It is now possible to make a report for multiple locations and multiple possible profiles KoswatBuildingsPolderside.get_classify_surroundings : We can now retrieve all points classified by their distance to the closest building KoswatSurroundings : Added wrapper class for surroundings and a builder for it. Extended other koswat/surrounding builder classes to be initialized from files. KoswatCsvFomBuilder;Koswat\\surroundings : We can now map the csv data to surrounding points and their distances to buildings. Adapted related code KoswatCsvReader : It is possible to read a CSV file into a FileObjectModelProtocol instance of KoswatCsvFom . Added new methods to fom and reader protocols, adapted related classes KoswatShpReader : Added KoswatShpReader to read from a shapefile. Added reader protocol and io module Refactor \u00b6 koswat/surroundings : Moved files into separate module dike : Renamed profiles module to dike for a more coherent approach cost_report : Moved directories into a better tree structure koswat/cost_report : Seggregated module into builders and reports. koswat/cost_report : Extracted reports into their own modules ProfileCostBuilder : Profile cost builder is independent of the profile type. All types of new profiles are calculated and then a report is done for each of them\" v0.3.0 (2022-10-03) \u00b6 Feat \u00b6 CharacteristicPoints : Created characteristic points to replace the previous 'ProtocolSide' related classes. Introduced builder to allow initial or reinforced profile creation KoswatLayersBuilder : We now can create layers based on the provided depth ProfileReinforcementCostBuilder : Generates a cost report for the new profile based on the extra required volume KoswatReport : Added KoswatReport to generate costs overviews It is now possible to create layers from a dictionary koswat_layers;koswat_profile_builder : Added new class to represent the layers of a profile, their material and so on. koswat/calculations : Added profile reinforcement calculation koswat/profiles : Added koswat profiles and related properties. They can now be built from an input profile v0.2.0 (2022-09-27) \u00b6 Feat \u00b6 koswat : Initial commit. Created Initial architecture and basic tests for the structure given. Added version control through commitizen","title":"Changelog"},{"location":"changelog.html#release-2023-2023-11-07","text":"","title":"Release-2023 (2023-11-07)"},{"location":"changelog.html#feat","text":"Added order_strategy submodule for determining reinforcement features across a dike traject based on default order Added new class to better handle / generate the location-reinforcement matrix","title":"Feat"},{"location":"changelog.html#fix","text":"improve rounding improve rounding improve rounding show cost per km if no locations present add @property to total_cost add @property to total_cost add @property to total_cost test on presence of construction costs correct return type Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString corrected berm width calculations (#114) corrected berm width calculations merge leftovers rename \"raise\" to \"surtax\" throughout KOSWAT rename \"raise\" to \"surtax\" throughout KOSWAT correct symbol name correct symbol name typo comment typo comment Added logic to avoid creating added / removed layers geometries when there were no modifications Added default values as math.nan for koswatscenario We now replace not-provided values from a KoswatScenario when calculating new reinforcements docu corrections docu corrections docu corrections","title":"Fix"},{"location":"changelog.html#v0141-2023-11-08","text":"","title":"v0.14.1 (2023-11-08)"},{"location":"changelog.html#v0140-2023-11-07","text":"","title":"v0.14.0 (2023-11-07)"},{"location":"changelog.html#feat_1","text":"Added order_strategy submodule for determining reinforcement features across a dike traject based on default order Added new class to better handle / generate the location-reinforcement matrix","title":"Feat"},{"location":"changelog.html#fix_1","text":"improve rounding improve rounding improve rounding show cost per km if no locations present add @property to total_cost add @property to total_cost add @property to total_cost test on presence of construction costs correct return type Added logic to plot new layer surfaces when they are either a LineString or a MultiLineString corrected berm width calculations (#114) corrected berm width calculations merge leftovers rename \"raise\" to \"surtax\" throughout KOSWAT rename \"raise\" to \"surtax\" throughout KOSWAT correct symbol name correct symbol name typo comment typo comment Added logic to avoid creating added / removed layers geometries when there were no modifications Added default values as math.nan for koswatscenario We now replace not-provided values from a KoswatScenario when calculating new reinforcements docu corrections docu corrections docu corrections","title":"Fix"},{"location":"changelog.html#v0130-2023-01-31","text":"","title":"v0.13.0 (2023-01-31)"},{"location":"changelog.html#feat_2","text":"volume_cost_parameters_builder.py : We now calculate the costs based on the ini input file","title":"Feat"},{"location":"changelog.html#v0121-2023-01-27","text":"","title":"v0.12.1 (2023-01-27)"},{"location":"changelog.html#fix_2","text":"calc_library.py : Standrad reinforcement calculation now uses a different method to make sure the added geometry is normalized","title":"Fix"},{"location":"changelog.html#v0120-2023-01-26","text":"","title":"v0.12.0 (2023-01-26)"},{"location":"changelog.html#feat_3","text":"koswat/cost_report : Koswat Summary now includes all available locations even if they are not suitable for any reinforcement profile. Adapted the rest of the classes to generate a proper matrix also during export","title":"Feat"},{"location":"changelog.html#v0117-2023-01-25","text":"","title":"v0.11.7 (2023-01-25)"},{"location":"changelog.html#fix_3","text":"calc_library.py : We now check whether the last point intersects with the line drawn between the first two points to avoid precission issues","title":"Fix"},{"location":"changelog.html#v0116-2023-01-25","text":"","title":"v0.11.6 (2023-01-25)"},{"location":"changelog.html#fix_4","text":"calc_library.py;koswat_coating_layer_builder.py : We now round up the coordinates of the calculated layers to avoid precision issues calc_library.py : Corrected collection of surface points, added extra plot for reinforced profiles","title":"Fix"},{"location":"changelog.html#v0115-2023-01-12","text":"","title":"v0.11.5 (2023-01-12)"},{"location":"changelog.html#fix_5","text":"calc_library : Small correction to avoid crashing when trying to order multiline strings","title":"Fix"},{"location":"changelog.html#v0114-2023-01-12","text":"","title":"v0.11.4 (2023-01-12)"},{"location":"changelog.html#fix_6","text":"standard_reinforcement_layers_wrapper_builder : Fixed sand layer added surface not being correct calc_library.py : After doing a geometry union the resulting geometry gets now their points in order","title":"Fix"},{"location":"changelog.html#v0113-2023-01-12","text":"","title":"v0.11.3 (2023-01-12)"},{"location":"changelog.html#fix_7","text":"koswat/configuration : Fixed creation of scenarios based on selected dike sections","title":"Fix"},{"location":"changelog.html#v0112-2022-12-21","text":"","title":"v0.11.2 (2022-12-21)"},{"location":"changelog.html#v0111-2022-12-20","text":"","title":"v0.11.1 (2022-12-20)"},{"location":"changelog.html#fix_8","text":"koswat/ main .py : Renamed main file to fit to python main expected module","title":"Fix"},{"location":"changelog.html#v0110-2022-12-20","text":"","title":"v0.11.0 (2022-12-20)"},{"location":"changelog.html#feat_4","text":"koswat/koswat_handler.py : We now accept a log_output argument to specify the directory where to save the koswat run log.","title":"Feat"},{"location":"changelog.html#v0100-2022-12-20","text":"","title":"v0.10.0 (2022-12-20)"},{"location":"changelog.html#feat_5","text":"koswat/configuration/converters : Created converters fom to dom koswat/configuration/io/converters/ : Added configuration converters for the analysis section. We can now generate input profiles from the ini files koswat/configuration/io/csv : Added import of KoswatInputProfiles KoswatHandler;KoswatLogger : Added handler and logger for koswat runs from CLI","title":"Feat"},{"location":"changelog.html#fix_9","text":"koswat/geometries/calc_library.py : We now order the points of the geometries so that calculations can be done correctly koswat/calculations : Corrected profile calculation for all types and their tests. These changes come directly from Peter de Grave koswat/configuration/io/koswat_run_settings_importer.py : corrected filtering of selected input profiles koswat_dike_locations_shp_reader.py : Fixed enumerating a filtered list instead of filtering after enumerating KoswatSurroundingsConverter : Fixed return as it was only giving the latest mapped FOM configuration/io/converters : Fixed return of data and adapted tests koswat_analysis_converter.py : Small fix to converter koswat_General_settings.py : Fix validation for surroundings koswat/calculations : Fixed calculations due to new profile input property KoswatMaterialType : Minor fix regarding usage of new KoswatMaterialType KoswatMaterialType : Adapted code to use the enum instead of strings","title":"Fix"},{"location":"changelog.html#refactor","text":"koswat/configuration/io : Moved converters into io koswat/dike/surroundings/io/shp : Moved shp reader and fom to surroundings module koswat/configuration : Integrating mapping of files to fom's during settings import koswat/dike/surroundings/io : Moved previous CSV reader into a concrete module within dike/surroundings. Created protocols for csv reading so it can be repurposed KoswatMaterialType : Made koswat material into an enum. Adapted code overall in the source","title":"Refactor"},{"location":"changelog.html#v090-2022-12-12","text":"","title":"v0.9.0 (2022-12-12)"},{"location":"changelog.html#feat_6","text":"KoswatGeneralSettings : Created DOM for koswat general settings configuration KoswatConfigurationIniImporter : We can now map all different ini fom classes to the config class koswat/configuration : Created koswat configuration module and related class KoswatConfiguration to encapsulate all require information for a koswat analysis KoswatScenarioIniFom : It is now possible to read a KoswatScenarioIniFom from file KoswatDikeSelectionIniFom : It is now possible to read a Dike Selection INI file into its corresponding FOM KoswatCostsIniFom : Added logic to fully implement reading of a KoswatCostsIniFom file KoswatCostsIniFom : Added koswat costs ini file KoswatIniReader : Created koswat ini reader and initial approach to reading the general Koswat INI file","title":"Feat"},{"location":"changelog.html#fix_10","text":"KoswatCosts : Added class conversion to dictionary","title":"Fix"},{"location":"changelog.html#refactor_1","text":"koswat/configuration/models : Moved configuration data object models into their own module. Fixed / grouped imports KoswatDikeSelection : Koswat dike selection now implements a new type KoswatDikeSelectionTxtFom with related reader koswat_scenario : Moved koswat scenario into koswat/configuration koswat/io : Adapted export / import fom protocol","title":"Refactor"},{"location":"changelog.html#v082-2022-12-09","text":"","title":"v0.8.2 (2022-12-09)"},{"location":"changelog.html#fix_11","text":"KoswatLayerProtocol : we now have two different geometries for a layer, so that the profile with the layer and the stand alone representation of it are better reached","title":"Fix"},{"location":"changelog.html#v081-2022-11-21","text":"","title":"v0.8.1 (2022-11-21)"},{"location":"changelog.html#fix_12","text":"SummaryMatrixCsvExporter : We now provide NANs when volume parameter is not defined summary_matrix_csv_exporter : We now correctly export all required information to the csv for the user","title":"Fix"},{"location":"changelog.html#v080-2022-11-19","text":"","title":"v0.8.0 (2022-11-19)"},{"location":"changelog.html#feat_7","text":"KoswatPlotContext : Created plot context handler so it's easier to initialize and close plots","title":"Feat"},{"location":"changelog.html#v070-2022-11-18","text":"","title":"v0.7.0 (2022-11-18)"},{"location":"changelog.html#feat_8","text":"koswat/cost_report/io/plots/ : Added module for cost_report export plots logic koswat_profile_plot.py : We can now set a unique color for layers_wrapper and profile plots koswat/plots/dike/ : Extracted dike plotting logic into separate classes koswat/plots/geometries : Created module with plotting for regular geometries from shapely","title":"Feat"},{"location":"changelog.html#fix_13","text":"koswat/plots/utils.py : Replaced wrapper as it is not a good approach characteristic_points_builder.py : Resolved a circular dependency","title":"Fix"},{"location":"changelog.html#refactor_2","text":"koswat/calculations/io/ : Extracted plot exporters from calculations into their corresponding directory koswat/plots : Create concrete module for plotting koswat/io : Moved io files into their corresponding modules","title":"Refactor"},{"location":"changelog.html#v060-2022-11-11","text":"","title":"v0.6.0 (2022-11-11)"},{"location":"changelog.html#feat_9","text":"VolumeCalculationParameters : Included all operations required to for volume calculation ReinforcementProfileProtocol : Added new property to retrieve the new ground level surface OutsideSlopeReinforcementLayersWrapperBuilder : Added builder for for the outside slope reinforcement layers wrapper StandardReinforcemetnLayersWrapperBuilder : Added logic to generate the geometries of a standard reinforcement dike ReinforcementLayersWrapper : We now have dedicated builders for the LayersWrapper associated with a Reinforcement ReinforcementProfileBuilderProtocol : Created protocol for better hierarchy CoatingLayerCostReport : Extended usage of previous StandardLayerCostReport so that other reinforcements can also use it Added logic to extract the surface of a layer LayerCostReportProtocol;StandardLayerCostReportBuilder : Extracted standard layer cost report builder logic into separate class. Added protocol to represent the layer cost reports koswat/geometries; standard_layer_cost_report : Implemented logic for StandardLayer cost calculation OutsideSlopeReinforcementProfileProtocol;StandardReinforcementProfileProtocol : Added protocols to represent the different types of reinforcement - per volume; Added tests for factory LayerCostReportbuilderFactory : Added logic to retrieve the corresponding LayerCostReportBuilderProtocol; Adapted tests and related imports LayerCostReportBuilderFactory : Introduced layer cost report builder factory for the different types of volume calculators available","title":"Feat"},{"location":"changelog.html#fix_14","text":"PipingWallReinforcementProfileCalculation : Solved wrong calculation of the Length Piping Wall StabilityWallReinforcementProfileCalculation : Corrected calculation of the length stability wall property StabilityWall calculation was not properly mapped OutsideSlopeProfileCostReportBuilder : Now we properly calculate the added core layer OutsideSlopeProfileCostReportBuilder : Calculation of the 'kistdam' layers is now done properly","title":"Fix"},{"location":"changelog.html#refactor_3","text":"koswat/calculations : Moved calculations into their respecitve reinforcement types Starting to move logic of added / removed layers to the calculation module cost_report : Moved layer factory to profile factory as the logic should be in a higher level","title":"Refactor"},{"location":"changelog.html#v051-2022-10-11","text":"","title":"v0.5.1 (2022-10-11)"},{"location":"changelog.html#fix_15","text":"SummaryMatrixCsvExporter : We now export the locations in order of import","title":"Fix"},{"location":"changelog.html#v050-2022-10-11","text":"","title":"v0.5.0 (2022-10-11)"},{"location":"changelog.html#feat_10","text":"SummaryMatrixCsvExporter : We now also export the CsvFom into a file SummaryMatrixCsvFom;SummaryMatrixCsvExporter : Added Summary Matrix Csv Fom and Exporter initial logic CofferDamInputProfile : Added concrete input profile for CofferDamReinforcementProfile calculations/cofferdam;CofferdamReinforcementProfileCalculation;CofferdamReinforcementProfile : Added Cofferdam Reinforcement Profile and Calculation to the calculations module. Added information to the summary to also build their report. StabilityWallInputProfile;StabilityWallReinforcementProfileCalculation : Created both concrete input profile and profile calculation for StabilityWallReinforcementProfile StabilityWallReinforcemetnProfile : Added StabilityWallReinforcementProfile type PipingWallInputProfile : Created dedicated input profile for PipingWall KoswatInputProfileProtocol : Made a Koswat Input Profile protocol to manage better concrete input profiles. Adapted existing code and tests PipingWallReinforcementProfileCalculation : Added calculation for PipingWall Reinforcement Profile PipingWall : Added PipingWallReinforcementProfile class ReinforcementProfileProtocol : Introduced ReinforcementProfileProtocol as a sub protocol of KoswatProfileProtocol. Adapted existent classes and tests. Moved existing calculations into calculations\\soil","title":"Feat"},{"location":"changelog.html#fix_16","text":"CofferdamReinforcementProfileCalculation : P4 x coordinate set to 0 for all builds from this calculation KoswatProfileBuilder : Removed paramater from build method to make it complier to the BuilderProtocol","title":"Fix"},{"location":"changelog.html#v040-2022-10-07","text":"","title":"v0.4.0 (2022-10-07)"},{"location":"changelog.html#feat_11","text":"MultiLocationMultiProfileCostBuilder : Added new report to summarize reports of profile per location. ListMultiLocationProfileCostBuilder : It is now possible to make a report for multiple locations and multiple possible profiles KoswatBuildingsPolderside.get_classify_surroundings : We can now retrieve all points classified by their distance to the closest building KoswatSurroundings : Added wrapper class for surroundings and a builder for it. Extended other koswat/surrounding builder classes to be initialized from files. KoswatCsvFomBuilder;Koswat\\surroundings : We can now map the csv data to surrounding points and their distances to buildings. Adapted related code KoswatCsvReader : It is possible to read a CSV file into a FileObjectModelProtocol instance of KoswatCsvFom . Added new methods to fom and reader protocols, adapted related classes KoswatShpReader : Added KoswatShpReader to read from a shapefile. Added reader protocol and io module","title":"Feat"},{"location":"changelog.html#refactor_4","text":"koswat/surroundings : Moved files into separate module dike : Renamed profiles module to dike for a more coherent approach cost_report : Moved directories into a better tree structure koswat/cost_report : Seggregated module into builders and reports. koswat/cost_report : Extracted reports into their own modules ProfileCostBuilder : Profile cost builder is independent of the profile type. All types of new profiles are calculated and then a report is done for each of them\"","title":"Refactor"},{"location":"changelog.html#v030-2022-10-03","text":"","title":"v0.3.0 (2022-10-03)"},{"location":"changelog.html#feat_12","text":"CharacteristicPoints : Created characteristic points to replace the previous 'ProtocolSide' related classes. Introduced builder to allow initial or reinforced profile creation KoswatLayersBuilder : We now can create layers based on the provided depth ProfileReinforcementCostBuilder : Generates a cost report for the new profile based on the extra required volume KoswatReport : Added KoswatReport to generate costs overviews It is now possible to create layers from a dictionary koswat_layers;koswat_profile_builder : Added new class to represent the layers of a profile, their material and so on. koswat/calculations : Added profile reinforcement calculation koswat/profiles : Added koswat profiles and related properties. They can now be built from an input profile","title":"Feat"},{"location":"changelog.html#v020-2022-09-27","text":"","title":"v0.2.0 (2022-09-27)"},{"location":"changelog.html#feat_13","text":"koswat : Initial commit. Created Initial architecture and basic tests for the structure given. Added version control through commitizen","title":"Feat"},{"location":"installation.html","text":"Installation \u00b6 Important! : The following installation steps are written based on a Windows environment. When using other systems (which should be possible) it might be required to use different commands. However, the fundamental of the installation steps should remain the same. This meaning, no additional packages or libraries should be required. If problems would arose during your installation, please contact the maintainers of the tool. For users \u00b6 When you only require the koswat package to be used as a whole, and not for developments, we advise to directly use the latest greatest release, or directly the latest available version from Master as follows: Latest available Master : pip install git+https://github.com/Deltares/Koswat.git Specific Koswat version, add @version-tag to the previous command, for instance install tag v0.11.0 ( MVP pre-release): pip install git+https://github.com/Deltares/Koswat.git@v0.11.0 | You can also do the above with a commit-hash for development branches (e.g.: @0504c06 ) Using docker (requires checking the repository in a directory): cd docker build -t koswat:latest -f Dockerimage . docker run -it koswat bash For developers \u00b6 Checkout the code from github in a directory of your choice. You can either do this by downloading the source zip or (better) using git, for instance: cd C: \\r epos git clone https://github.com/Deltares/Koswat.git koswat | Note, the above steps are based on a Windows setup. If you are not familiar with Git we recommend using the GitHub desktop tool . Navigate to your Koswat repository and then install the koswat package with your preferred step: With Miniforge (our recommendation): cd C: \\r epos \\k oswat conda env create -f .config \\e nvironment.yml conda activate koswat_env poetry install With pypi : cd C: \\r epos \\k oswat pip install . | Note, this will not install Poetry , which is required to properly maintain the interdependencies of Koswat tool.","title":"Installation"},{"location":"installation.html#installation","text":"Important! : The following installation steps are written based on a Windows environment. When using other systems (which should be possible) it might be required to use different commands. However, the fundamental of the installation steps should remain the same. This meaning, no additional packages or libraries should be required. If problems would arose during your installation, please contact the maintainers of the tool.","title":"Installation"},{"location":"installation.html#for-users","text":"When you only require the koswat package to be used as a whole, and not for developments, we advise to directly use the latest greatest release, or directly the latest available version from Master as follows: Latest available Master : pip install git+https://github.com/Deltares/Koswat.git Specific Koswat version, add @version-tag to the previous command, for instance install tag v0.11.0 ( MVP pre-release): pip install git+https://github.com/Deltares/Koswat.git@v0.11.0 | You can also do the above with a commit-hash for development branches (e.g.: @0504c06 ) Using docker (requires checking the repository in a directory): cd docker build -t koswat:latest -f Dockerimage . docker run -it koswat bash","title":"For users"},{"location":"installation.html#for-developers","text":"Checkout the code from github in a directory of your choice. You can either do this by downloading the source zip or (better) using git, for instance: cd C: \\r epos git clone https://github.com/Deltares/Koswat.git koswat | Note, the above steps are based on a Windows setup. If you are not familiar with Git we recommend using the GitHub desktop tool . Navigate to your Koswat repository and then install the koswat package with your preferred step: With Miniforge (our recommendation): cd C: \\r epos \\k oswat conda env create -f .config \\e nvironment.yml conda activate koswat_env poetry install With pypi : cd C: \\r epos \\k oswat pip install . | Note, this will not install Poetry , which is required to properly maintain the interdependencies of Koswat tool.","title":"For developers"},{"location":"user_manual.html","text":"User manual \u00b6 As a command line tool \u00b6 When using Koswat as a package you can run it directly from the command line as follows: python -m koswat --input_file path\\\\to\\\\your\\\\koswat.ini --log_output path\\\\to\\\\your\\\\output\\\\dir The arguments are: --input_file (required): Absolute path to the location of your general koswat.ini file. --log_output (optional): Absolute path to the location of where the koswat.log will be written. If not specified it will be written at the root of the execution directory. It is also possible to check all the above possibilities via the --help argument in the command line: python -m koswat --help As a sandbox \u00b6 It is entirely possible to make a custom Koswat analysis using the tool as a sandbox. This means, through a script calling the different classes to generate an analysis. As a simple example, we can rewrite the acceptance test test_given_surrounding_files_run_calculations_for_all_included_profiles : from koswat.dike.profile.koswat_input_profile_base import KoswatInputProfileBase from koswat.dike.material.koswat_material_type import KoswatMaterialType from koswat.configuration.settings.koswat_scenario import KoswatScenario from koswat.dike.profile import KoswatProfileBase , KoswatProfileBuilder from koswat.cost_report.summary import KoswatSummary , KoswatSummaryBuilder from koswat.configuration.settings.koswat_run_scenario_settings import ( KoswatRunScenarioSettings , ) from koswat.cost_report.io.summary.koswat_summary_exporter import KoswatSummaryExporter from koswat.cost_report.io.plots.multi_location_profile_comparison_plot_exporter import ( MultiLocationProfileComparisonPlotExporter , ) from koswat.dike_reinforcements import ReinforcementProfileBuilderFactory # 1. Define input data. _input_dir = Path ( \"C: \\\\ my_koswat_input_dir\" ) _output_dir = Path ( \"C: \\\\ my_koswat_results\" ) _shp_trajects_file = ( _input_dir / \"Dijkvak\" / \"Dijkringlijnen_KOSWAT_Totaal_2017_10_3_Dijkvak.shp\" ) assert _shp_trajects_file . is_file () ## Define input profile case input_profile_case = KoswatInputProfileBase () input_profile_case . dike_section = \"test_data\" input_profile_case . waterside_ground_level = 0 input_profile_case . waterside_slope = 3 input_profile_case . waterside_berm_width = 0 input_profile_case . waterside_berm_height = 0 input_profile_case . crest_height = 6 input_profile_case . crest_width = 5 input_profile_case . polderside_slope = 3 input_profile_case . polderside_berm_height = 0 input_profile_case . polderside_berm_width = 0 input_profile_case . polderside_ground_level = 0 input_profile_case . pleistocene = - 5 input_profile_case . aquifer = - 2 ## Define the scenario case scenario_case = KoswatScenario () scenario_case . scenario_name = \"\" scenario_case . scenario_section = \"\" scenario_case . d_h = 1 scenario_case . d_s = 10 scenario_case . d_p = 30 scenario_case . crest_width = 5 scenario_case . waterside_slope = 3 ## Define the layers case layers_case = dict ( base_layer = dict ( material = KoswatMaterialType . SAND ), coating_layers = [ dict ( material = KoswatMaterialType . GRASS , depth = 0.3 ), dict ( material = KoswatMaterialType . CLAY , depth = 0.5 ), ], ) ## Import surroundings (TODO: update with latest implementation of SurroundingsWrapperCollectionImporter) _surroundings_importer = KoswatSurroundingsImporter () _surroundings_importer . traject_loc_shp_file = _shp_trajects_file _surroundings = _surroundings_importer . import_from ( _test_dir )[ 0 ] assert isinstance ( scenario_case , KoswatScenario ) _base_koswat_profile = KoswatProfileBuilder . with_data ( dict ( input_profile_data = input_profile_case , layers_data = layers_case , profile_type = KoswatProfileBase , ) ) . build () ## Define the run settings based on the previous calculated parameters. _run_settings = KoswatRunScenarioSettings () _run_settings . scenario = scenario_case _run_settings . surroundings = _surroundings _run_settings . input_profile_case = _base_koswat_profile # 2. Run summary _multi_loc_multi_prof_cost_builder = KoswatSummaryBuilder () _multi_loc_multi_prof_cost_builder . run_scenario_settings = _run_settings _summary = _multi_loc_multi_prof_cost_builder . build () KoswatSummaryExporter () . export ( _summary , _output_dir ) # 3. Generate plots assert isinstance ( _summary , KoswatSummary ) assert any ( _summary . locations_profile_report_list ) for ( _reinforcement_profile ) in ReinforcementProfileBuilderFactory . get_available_reinforcements (): assert any ( isinstance ( _rep_profile . profile_cost_report . reinforced_profile , _reinforcement_profile , ) for _rep_profile in _summary . locations_profile_report_list ), f \"Profile type { _reinforcement_profile . __name__ } not found.\" for _multi_report in _summary . locations_profile_report_list : _mlp_plot = MultiLocationProfileComparisonPlotExporter () _mlp_plot . cost_report = _multi_report _mlp_plot . export_dir = _output_dir _mlp_plot . export ()","title":"User manual"},{"location":"user_manual.html#user-manual","text":"","title":"User manual"},{"location":"user_manual.html#as-a-command-line-tool","text":"When using Koswat as a package you can run it directly from the command line as follows: python -m koswat --input_file path\\\\to\\\\your\\\\koswat.ini --log_output path\\\\to\\\\your\\\\output\\\\dir The arguments are: --input_file (required): Absolute path to the location of your general koswat.ini file. --log_output (optional): Absolute path to the location of where the koswat.log will be written. If not specified it will be written at the root of the execution directory. It is also possible to check all the above possibilities via the --help argument in the command line: python -m koswat --help","title":"As a command line tool"},{"location":"user_manual.html#as-a-sandbox","text":"It is entirely possible to make a custom Koswat analysis using the tool as a sandbox. This means, through a script calling the different classes to generate an analysis. As a simple example, we can rewrite the acceptance test test_given_surrounding_files_run_calculations_for_all_included_profiles : from koswat.dike.profile.koswat_input_profile_base import KoswatInputProfileBase from koswat.dike.material.koswat_material_type import KoswatMaterialType from koswat.configuration.settings.koswat_scenario import KoswatScenario from koswat.dike.profile import KoswatProfileBase , KoswatProfileBuilder from koswat.cost_report.summary import KoswatSummary , KoswatSummaryBuilder from koswat.configuration.settings.koswat_run_scenario_settings import ( KoswatRunScenarioSettings , ) from koswat.cost_report.io.summary.koswat_summary_exporter import KoswatSummaryExporter from koswat.cost_report.io.plots.multi_location_profile_comparison_plot_exporter import ( MultiLocationProfileComparisonPlotExporter , ) from koswat.dike_reinforcements import ReinforcementProfileBuilderFactory # 1. Define input data. _input_dir = Path ( \"C: \\\\ my_koswat_input_dir\" ) _output_dir = Path ( \"C: \\\\ my_koswat_results\" ) _shp_trajects_file = ( _input_dir / \"Dijkvak\" / \"Dijkringlijnen_KOSWAT_Totaal_2017_10_3_Dijkvak.shp\" ) assert _shp_trajects_file . is_file () ## Define input profile case input_profile_case = KoswatInputProfileBase () input_profile_case . dike_section = \"test_data\" input_profile_case . waterside_ground_level = 0 input_profile_case . waterside_slope = 3 input_profile_case . waterside_berm_width = 0 input_profile_case . waterside_berm_height = 0 input_profile_case . crest_height = 6 input_profile_case . crest_width = 5 input_profile_case . polderside_slope = 3 input_profile_case . polderside_berm_height = 0 input_profile_case . polderside_berm_width = 0 input_profile_case . polderside_ground_level = 0 input_profile_case . pleistocene = - 5 input_profile_case . aquifer = - 2 ## Define the scenario case scenario_case = KoswatScenario () scenario_case . scenario_name = \"\" scenario_case . scenario_section = \"\" scenario_case . d_h = 1 scenario_case . d_s = 10 scenario_case . d_p = 30 scenario_case . crest_width = 5 scenario_case . waterside_slope = 3 ## Define the layers case layers_case = dict ( base_layer = dict ( material = KoswatMaterialType . SAND ), coating_layers = [ dict ( material = KoswatMaterialType . GRASS , depth = 0.3 ), dict ( material = KoswatMaterialType . CLAY , depth = 0.5 ), ], ) ## Import surroundings (TODO: update with latest implementation of SurroundingsWrapperCollectionImporter) _surroundings_importer = KoswatSurroundingsImporter () _surroundings_importer . traject_loc_shp_file = _shp_trajects_file _surroundings = _surroundings_importer . import_from ( _test_dir )[ 0 ] assert isinstance ( scenario_case , KoswatScenario ) _base_koswat_profile = KoswatProfileBuilder . with_data ( dict ( input_profile_data = input_profile_case , layers_data = layers_case , profile_type = KoswatProfileBase , ) ) . build () ## Define the run settings based on the previous calculated parameters. _run_settings = KoswatRunScenarioSettings () _run_settings . scenario = scenario_case _run_settings . surroundings = _surroundings _run_settings . input_profile_case = _base_koswat_profile # 2. Run summary _multi_loc_multi_prof_cost_builder = KoswatSummaryBuilder () _multi_loc_multi_prof_cost_builder . run_scenario_settings = _run_settings _summary = _multi_loc_multi_prof_cost_builder . build () KoswatSummaryExporter () . export ( _summary , _output_dir ) # 3. Generate plots assert isinstance ( _summary , KoswatSummary ) assert any ( _summary . locations_profile_report_list ) for ( _reinforcement_profile ) in ReinforcementProfileBuilderFactory . get_available_reinforcements (): assert any ( isinstance ( _rep_profile . profile_cost_report . reinforced_profile , _reinforcement_profile , ) for _rep_profile in _summary . locations_profile_report_list ), f \"Profile type { _reinforcement_profile . __name__ } not found.\" for _multi_report in _summary . locations_profile_report_list : _mlp_plot = MultiLocationProfileComparisonPlotExporter () _mlp_plot . cost_report = _multi_report _mlp_plot . export_dir = _output_dir _mlp_plot . export ()","title":"As a sandbox"},{"location":"reference/koswat_architecture.html","text":"Koswat design \u00b6 In general, the architecture of this package is based on the following principles: Single responsibility principle, component hierarchy . Open-closed principle, inheritance . Interface segregation principle, protocols . Component-module hierarchy \u00b6 We cluster entities into modules (components) that represent their domain and have minimal dependencies with others components, this way the modules can be accessed when operating Koswat as a sandbox. Within each component we apply the same principle and create sub-modules to reduce dependencies. At the current (unreleased) version v.0.15.0 the component hierarchy looks like follows: koswat/ configuration/ # Data structures required for a koswat run. geometries/ io/ settings/ core/ # Generic definitions and functionatilities. geometries/ io/ protocols/ cost_report/ # Summary of costs per dike reinforcement. io/ infrastructure/ multi_location_profile/ profile/ summary/ dike/ # Definition of a koswat dike. characteristic_points/ layers/ material/ profile/ surroundings/ dike_reinforcements/ # Dike calculations to generate possible reinforcements. input_profile/ io/ reinforcement_layers/ reinforcement_profile/ plots/ # Generic functionality for plotting. dike/ geometries/ strategies/ # Different selection methods of all possible dike reinforcements alongside a dike traject. order_strategy And the components interdependencies could be slightly represented as in the following diagram: Image 1. Component diagram Inheritance \u00b6 To facilitate the Open-Closed principle most of our classes have parameterless constructors ( __init__ method). Then, to instantiate objects we often relay on the implementation of builder patterns Protocols \u00b6 In Koswat we make use of Protocols to define the required and essential properties and methods that represent an entity. Although Python does not always enforce these types as other OO languages would do (for instance C#), we try to follow and respect this principle throughought the whole repository. Builder pattern \u00b6 Check for instance this wikipedia article for a more detailed reference. Because most of our classes have dependencies on other classes their initialization would require multiple steps that would become tedious and hard to maintain if they were defined in the default init method. Moreover, this approach would violate the open-closed principle. Therefore, we apply the builder pattern to reduce complexity at the classes, improving maintainability and enabling future developments to create a separate builder shall the design require a different way of instantiating a given class.","title":"Koswat design"},{"location":"reference/koswat_architecture.html#koswat-design","text":"In general, the architecture of this package is based on the following principles: Single responsibility principle, component hierarchy . Open-closed principle, inheritance . Interface segregation principle, protocols .","title":"Koswat design"},{"location":"reference/koswat_architecture.html#component-module-hierarchy","text":"We cluster entities into modules (components) that represent their domain and have minimal dependencies with others components, this way the modules can be accessed when operating Koswat as a sandbox. Within each component we apply the same principle and create sub-modules to reduce dependencies. At the current (unreleased) version v.0.15.0 the component hierarchy looks like follows: koswat/ configuration/ # Data structures required for a koswat run. geometries/ io/ settings/ core/ # Generic definitions and functionatilities. geometries/ io/ protocols/ cost_report/ # Summary of costs per dike reinforcement. io/ infrastructure/ multi_location_profile/ profile/ summary/ dike/ # Definition of a koswat dike. characteristic_points/ layers/ material/ profile/ surroundings/ dike_reinforcements/ # Dike calculations to generate possible reinforcements. input_profile/ io/ reinforcement_layers/ reinforcement_profile/ plots/ # Generic functionality for plotting. dike/ geometries/ strategies/ # Different selection methods of all possible dike reinforcements alongside a dike traject. order_strategy And the components interdependencies could be slightly represented as in the following diagram: Image 1. Component diagram","title":"Component-module hierarchy"},{"location":"reference/koswat_architecture.html#inheritance","text":"To facilitate the Open-Closed principle most of our classes have parameterless constructors ( __init__ method). Then, to instantiate objects we often relay on the implementation of builder patterns","title":"Inheritance"},{"location":"reference/koswat_architecture.html#protocols","text":"In Koswat we make use of Protocols to define the required and essential properties and methods that represent an entity. Although Python does not always enforce these types as other OO languages would do (for instance C#), we try to follow and respect this principle throughought the whole repository.","title":"Protocols"},{"location":"reference/koswat_architecture.html#builder-pattern","text":"Check for instance this wikipedia article for a more detailed reference. Because most of our classes have dependencies on other classes their initialization would require multiple steps that would become tedious and hard to maintain if they were defined in the default init method. Moreover, this approach would violate the open-closed principle. Therefore, we apply the builder pattern to reduce complexity at the classes, improving maintainability and enabling future developments to create a separate builder shall the design require a different way of instantiating a given class.","title":"Builder pattern"},{"location":"reference/koswat_cost_report.html","text":"Cost report \u00b6 A Koswat report is divided in different parts: Summary report : A summary containing all 'location reports'. Location report : Which profile reinforcements can be applied to each location based on their surroundings and reinforcement properties ( MultiLocationProfileCostReport ). Infrastructure report : ( InfrastructureLocationProfileCostReport ) Costs related to applying all calculated reinforcement profiles at the locations where infrastructures are present. Profile report : ( ProfileCostReport ), what are the (material) volume costs associated when applying a given reinforced profile . Layer report : A sub report of the 'profile report' which breaks down the different costs of each one of the layers. This can be seen in Image 1 Volume costs . Image 1. Volume costs Infrastructure report \u00b6 When determining the costs of infrastructures we look mainly at: The reinforcement profile ( ReinforcementProfileProtocol ) zones A and B. The distance between a dike and an infrastructure ( SurroundingsInfrastructure.points , PointSurroundings.surroundings_matrix ). These characteristics are then used to estimate how much surface of the infrastructures will be affected by the reinforced profile and therefore their associated cost. Reinforcement profile zones \u00b6 A reinforced profile can be different from its original state in many ways, however here we are only intestered in two things: The new profile's width from the original waterside crest point. Whether there is a crest's height increase ( dh0 ), By using the old and the reinforced profile's geometries, we can determine what we call zone A and zone B , A + B = {profile's width from waterside crest point} . Zone A represents the width of the dike old profile's crest (highest surface). Zone B the distance between said crest and the end of the dike's reinforcement. Image 1. Reinforcement with dh0 = 0 However, when the crest's height of a ReinforcementProfileProtocol has increased in comparison to its original profile ( ReinforcementProfileProtocol.old_profile , KoswatProfileProtocol ) then we set zone A = 0 and therefore B = {profile's width from waterside crest point} . Image 2. Reinforcement with dh0 = 1 Infrastructure's distances \u00b6 An infrastructure ( SurroundingsInfrastructure ) can be present at different locations ( SurroundingsInfrastructure.points ). Each of these locations ( PointSurroundings ) contains a dictionary ( surroundings_matrix: dict[float, float] ) where the key is the distance between said location and the infrastructure and the values represent the length of the infrastructure found at that distance. For instance, we could have surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5} , which means: - Between 0 and 5 meters from the location we will find 1.5 meters of the infrastructure, - Between 5 and 10 meters from the location we will find 0 meters of the infrastructure, - Between 10 and 15 meters from the location we will find 2.5 meters of the infrastructure. In addition, each infrastructure has a fixed width ( SurroundingsInfrastructure.infrastructure_width ), which can later be used to calculate the total surface of said infrastructure affected by the given profile. So: affected_infra_zone_x = meters_of_infrastructure_in_zone_x * infrastructure_width , where meters_of_infrastructure_in_zone_x are the values calculated from the surroundings_matrix and infrastructure_width is the infrastructure fixed width. Cost calculation \u00b6 After defining the profile's zones A and B we can easily find how much of each infrastructures is affected by checking the surroundings_matrix indices and \"rounding\" up. It is agreed that at the overlapping points between A and B , the affected surface, and therefore costs, will only be computed for zone A ; this is done regardless of the chosen infrastructure costs type ( InfraCostsEnum ). Once the total area is known, we only need to multiply them by their related costs for adding and/or removing infrastructure's material. Example \u00b6 Using as example the previous surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5} we can demostrate this when A = 4 and B = 10 . Estimate zone limits: zone_a goes from 0 to 4, zone_b goes from 4 to 14. Estimate affected points in the surroundings matrix: zone_a affects only up until key 5 , so 1.5 meters of infrastructure. zone_b affects keys 10 and 15 , so 2.5 meters of infrastructure. Note that we do not take 5 as has already been considered for zone_a . Generated files \u00b6 After running a Koswat analysis, several files and directories will be generated. Usually the structure will be as follows: Dike profile section scenarios -> Scenario -> Generated files Dike profile - scenarios directory: Each dike can be run using different scenarios. Scenario: Scenario being applied to the selected dike profile. Dike section: The selected dike section being analyzed. Generated files: A combination of images and a 'csv' matrix result. Images: Visual description of each of the possible reinforcements being applied. summary_costs.csv : A csv file containing all the costs information of the summary. Represents the Summary, Profile and Layer report. summary_locations.csv : A csv file containing per-location a breakdown of available reinforcements and selected reinforcement ( see strategies ). Represents the Location report. /summary_locations directory: contains the following .shp files (and their related binaries): - summary_locations_measures : The same data as present in summary_locations.csv is used to shape the geometry of a dike's traject. We keep as well the type of chosen reinforcement. summary_locations_new : an overlay of summary_locations_measures with the geometry buffered in relation to the new selected reinforcement. summary_locations_old : an overlay of summary_locations_measures with the geometry buffered in relation to the original selected reinforcement. summary_locations_step : an overlay of summary_locations_measures with the geometry buffered in relation to the Ordered Strategy step. summary_infrastructure_costs.csv : A csv file contaning all the infrastructure costs at each location for each of the supported reinforcement profile types. Represents the Infrastructure Report . Example using a summarized view of the output tree directory when running the acceptance test test_main.test_given_valid_input_succeeds : acceptance | koswat.log | +-- results_output | +-- dike_10-1-1-A-1-A | | +-- scenario_scenario1 | | | | Grondmaatregel_profiel.png | | | | Kistdam.png | | | | Kwelscherm.png | | | | summary_costs.csv | | | | summary_locations.csv | | | | summary_infrastructure_costs.csv | | | | Stabiliteitswand.png | | | | Verticale_piping_oplossing.png | | | | | | | +-- summary_locations | | | | summary_locations_measures.cpg | | | | summary_locations_measures.dbf | | | | summary_locations_measures.prj | | | | summary_locations_measures.shp | | | | summary_locations_measures.shx | | | | summary_locations_new.cpg | | | | summary_locations_new.dbf | | | | summary_locations_new.prj | | | | summary_locations_new.shp | | | | summary_locations_new.shx | | | | summary_locations_old.cpg | | | | summary_locations_old.dbf | | | | summary_locations_old.prj | | | | summary_locations_old.shp | | | | summary_locations_step.shx | | | | summary_locations_step.cpg | | | | summary_locations_step.dbf | | | | summary_locations_step.prj | | | | summary_locations_step.shp | | | | summary_locations_step.shx | | | +-- Grondmaatregel_profiel | | | | added_Grondmaatregel_profiel_CLAY.png | | | | added_Grondmaatregel_profiel_GRASS.png | | | | added_Grondmaatregel_profiel_SAND.png | | | | removed_Grondmaatregel_profiel_CLAY.png | | | | removed_Grondmaatregel_profiel_GRASS.png | | | +-- Kistdam | | | | ... | | | | | | +-- Kwelscherm | | | | ... | | | | | | +-- Stabiliteitswand | | | | ... | | | | | | +-- Verticale_piping_oplossing | | | | ... | | | | | +-- scenario_scenario2 | | | ...","title":"Cost report"},{"location":"reference/koswat_cost_report.html#cost-report","text":"A Koswat report is divided in different parts: Summary report : A summary containing all 'location reports'. Location report : Which profile reinforcements can be applied to each location based on their surroundings and reinforcement properties ( MultiLocationProfileCostReport ). Infrastructure report : ( InfrastructureLocationProfileCostReport ) Costs related to applying all calculated reinforcement profiles at the locations where infrastructures are present. Profile report : ( ProfileCostReport ), what are the (material) volume costs associated when applying a given reinforced profile . Layer report : A sub report of the 'profile report' which breaks down the different costs of each one of the layers. This can be seen in Image 1 Volume costs . Image 1. Volume costs","title":"Cost report"},{"location":"reference/koswat_cost_report.html#infrastructure-report","text":"When determining the costs of infrastructures we look mainly at: The reinforcement profile ( ReinforcementProfileProtocol ) zones A and B. The distance between a dike and an infrastructure ( SurroundingsInfrastructure.points , PointSurroundings.surroundings_matrix ). These characteristics are then used to estimate how much surface of the infrastructures will be affected by the reinforced profile and therefore their associated cost.","title":"Infrastructure report"},{"location":"reference/koswat_cost_report.html#reinforcement-profile-zones","text":"A reinforced profile can be different from its original state in many ways, however here we are only intestered in two things: The new profile's width from the original waterside crest point. Whether there is a crest's height increase ( dh0 ), By using the old and the reinforced profile's geometries, we can determine what we call zone A and zone B , A + B = {profile's width from waterside crest point} . Zone A represents the width of the dike old profile's crest (highest surface). Zone B the distance between said crest and the end of the dike's reinforcement. Image 1. Reinforcement with dh0 = 0 However, when the crest's height of a ReinforcementProfileProtocol has increased in comparison to its original profile ( ReinforcementProfileProtocol.old_profile , KoswatProfileProtocol ) then we set zone A = 0 and therefore B = {profile's width from waterside crest point} . Image 2. Reinforcement with dh0 = 1","title":"Reinforcement profile zones"},{"location":"reference/koswat_cost_report.html#infrastructures-distances","text":"An infrastructure ( SurroundingsInfrastructure ) can be present at different locations ( SurroundingsInfrastructure.points ). Each of these locations ( PointSurroundings ) contains a dictionary ( surroundings_matrix: dict[float, float] ) where the key is the distance between said location and the infrastructure and the values represent the length of the infrastructure found at that distance. For instance, we could have surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5} , which means: - Between 0 and 5 meters from the location we will find 1.5 meters of the infrastructure, - Between 5 and 10 meters from the location we will find 0 meters of the infrastructure, - Between 10 and 15 meters from the location we will find 2.5 meters of the infrastructure. In addition, each infrastructure has a fixed width ( SurroundingsInfrastructure.infrastructure_width ), which can later be used to calculate the total surface of said infrastructure affected by the given profile. So: affected_infra_zone_x = meters_of_infrastructure_in_zone_x * infrastructure_width , where meters_of_infrastructure_in_zone_x are the values calculated from the surroundings_matrix and infrastructure_width is the infrastructure fixed width.","title":"Infrastructure's distances"},{"location":"reference/koswat_cost_report.html#cost-calculation","text":"After defining the profile's zones A and B we can easily find how much of each infrastructures is affected by checking the surroundings_matrix indices and \"rounding\" up. It is agreed that at the overlapping points between A and B , the affected surface, and therefore costs, will only be computed for zone A ; this is done regardless of the chosen infrastructure costs type ( InfraCostsEnum ). Once the total area is known, we only need to multiply them by their related costs for adding and/or removing infrastructure's material.","title":"Cost calculation"},{"location":"reference/koswat_cost_report.html#example","text":"Using as example the previous surroundings_matrix = {5: 1.5, 10: 0, 15: 2.5} we can demostrate this when A = 4 and B = 10 . Estimate zone limits: zone_a goes from 0 to 4, zone_b goes from 4 to 14. Estimate affected points in the surroundings matrix: zone_a affects only up until key 5 , so 1.5 meters of infrastructure. zone_b affects keys 10 and 15 , so 2.5 meters of infrastructure. Note that we do not take 5 as has already been considered for zone_a .","title":"Example"},{"location":"reference/koswat_cost_report.html#generated-files","text":"After running a Koswat analysis, several files and directories will be generated. Usually the structure will be as follows: Dike profile section scenarios -> Scenario -> Generated files Dike profile - scenarios directory: Each dike can be run using different scenarios. Scenario: Scenario being applied to the selected dike profile. Dike section: The selected dike section being analyzed. Generated files: A combination of images and a 'csv' matrix result. Images: Visual description of each of the possible reinforcements being applied. summary_costs.csv : A csv file containing all the costs information of the summary. Represents the Summary, Profile and Layer report. summary_locations.csv : A csv file containing per-location a breakdown of available reinforcements and selected reinforcement ( see strategies ). Represents the Location report. /summary_locations directory: contains the following .shp files (and their related binaries): - summary_locations_measures : The same data as present in summary_locations.csv is used to shape the geometry of a dike's traject. We keep as well the type of chosen reinforcement. summary_locations_new : an overlay of summary_locations_measures with the geometry buffered in relation to the new selected reinforcement. summary_locations_old : an overlay of summary_locations_measures with the geometry buffered in relation to the original selected reinforcement. summary_locations_step : an overlay of summary_locations_measures with the geometry buffered in relation to the Ordered Strategy step. summary_infrastructure_costs.csv : A csv file contaning all the infrastructure costs at each location for each of the supported reinforcement profile types. Represents the Infrastructure Report . Example using a summarized view of the output tree directory when running the acceptance test test_main.test_given_valid_input_succeeds : acceptance | koswat.log | +-- results_output | +-- dike_10-1-1-A-1-A | | +-- scenario_scenario1 | | | | Grondmaatregel_profiel.png | | | | Kistdam.png | | | | Kwelscherm.png | | | | summary_costs.csv | | | | summary_locations.csv | | | | summary_infrastructure_costs.csv | | | | Stabiliteitswand.png | | | | Verticale_piping_oplossing.png | | | | | | | +-- summary_locations | | | | summary_locations_measures.cpg | | | | summary_locations_measures.dbf | | | | summary_locations_measures.prj | | | | summary_locations_measures.shp | | | | summary_locations_measures.shx | | | | summary_locations_new.cpg | | | | summary_locations_new.dbf | | | | summary_locations_new.prj | | | | summary_locations_new.shp | | | | summary_locations_new.shx | | | | summary_locations_old.cpg | | | | summary_locations_old.dbf | | | | summary_locations_old.prj | | | | summary_locations_old.shp | | | | summary_locations_step.shx | | | | summary_locations_step.cpg | | | | summary_locations_step.dbf | | | | summary_locations_step.prj | | | | summary_locations_step.shp | | | | summary_locations_step.shx | | | +-- Grondmaatregel_profiel | | | | added_Grondmaatregel_profiel_CLAY.png | | | | added_Grondmaatregel_profiel_GRASS.png | | | | added_Grondmaatregel_profiel_SAND.png | | | | removed_Grondmaatregel_profiel_CLAY.png | | | | removed_Grondmaatregel_profiel_GRASS.png | | | +-- Kistdam | | | | ... | | | | | | +-- Kwelscherm | | | | ... | | | | | | +-- Stabiliteitswand | | | | ... | | | | | | +-- Verticale_piping_oplossing | | | | ... | | | | | +-- scenario_scenario2 | | | ...","title":"Generated files"},{"location":"reference/koswat_dike.html","text":"Dike profile \u00b6 In this section we will describe how a Koswat dike is defined and what its parts are. Koswat properties \u00b6 A koswat dike is represented by an instance of a KoswatProfileProtocol . And its properties represent different aspects of a 'real domain'. With Image 1. Base profile properties as reference, we can see the mapping between said 'real domain' and the koswat properties: input_data : The parts of a dike (written on the image reference), which are directly mapped as an implementation of the KoswatInputProfileProtocol . characteristic_points : 8 points given by the user describing the dike on (x,y) coordinates, the first four represent the waterside ( buitendijks ), the last four the polderside ( binnendijks ). Numbered in the reference picture from 1 to 8. Point 4 is considered to be the reference value (0) with respect to distances of e.g. surroundings and widths of certain parts of the dike. layers_wrapper : The description on how the layers of the dike are built. Further described in Dike layers . location : Geospatial coordinates (x, y) where the dike is situated. profile_width : The difference between the lowest and the highest 'x' coordinates of the profile characteristic points. The distance between characteristic points 1 and 8. This can be broken down into: waterside_width : The distance between characteristics points 1 and 4. polderside_width : The distance between characteristics points 4 and 8. Image 1. Base profile properties The geometry of a dike has certain additional characteristics: - crest ( kruin ): The flat part on top of the dike. - berm ( berm ): The flat part between either point 2 and 3 (waterside) or point 6 an 7 (polderside). - slope ( talud ): The (steepness of the) diagonal parts between points 1 and 4 (waterside) or points 5 and 8 (polderside). - ground level ( maaiveld ): The level of the area to the left of point 1 (waterside) or to the right of point 8 (polderside). Dike layers \u00b6 A dike is composed by three layers: Sand, the core layer. Clay, a coating layer. Grass, a (top) coating layer. These layers are wrapped under a KoswatLayersWrapperProtocol instance. At the same time, each layer is an instance of a KoswatLayerProtocol containing the following properties: material_type : Either Sand, Clay or Grass. upper_points : The surface points of the layer. This property can be used to calculate the surface (m 2 ) of a material. outer_geometry : A polygon representing the material layer and the 'wrapped' polygons. For instance, the Clay outer_geometry will also include the Sand material_geometry . material_geometry : A closed polygon containing only the points representing the layer. Using Image 3. Clay layer highlighted as an example, we can map the previous properties: material_type : Clay, the 'in-between' layer. upper_points : Line with the 'orange' points, without 'closing' the polygon, something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0)]. outer_geometry : Closed geometry using the upper points and the 'ground level' ( maaiveld ) points: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (-18, 0) ]. material_geometry : Closed geometry using the upper_points from Clay and the upper_points from the layer below (Sand, green points). Should be something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (19, 0), (8, 4.75), (0, 4.75), (-14, 0), (-18, 0) ] Image 2. Sand layer highlighted Image 3. Clay layer highlighted Image 4. Grass layer highlighted","title":"Dike profile"},{"location":"reference/koswat_dike.html#dike-profile","text":"In this section we will describe how a Koswat dike is defined and what its parts are.","title":"Dike profile"},{"location":"reference/koswat_dike.html#koswat-properties","text":"A koswat dike is represented by an instance of a KoswatProfileProtocol . And its properties represent different aspects of a 'real domain'. With Image 1. Base profile properties as reference, we can see the mapping between said 'real domain' and the koswat properties: input_data : The parts of a dike (written on the image reference), which are directly mapped as an implementation of the KoswatInputProfileProtocol . characteristic_points : 8 points given by the user describing the dike on (x,y) coordinates, the first four represent the waterside ( buitendijks ), the last four the polderside ( binnendijks ). Numbered in the reference picture from 1 to 8. Point 4 is considered to be the reference value (0) with respect to distances of e.g. surroundings and widths of certain parts of the dike. layers_wrapper : The description on how the layers of the dike are built. Further described in Dike layers . location : Geospatial coordinates (x, y) where the dike is situated. profile_width : The difference between the lowest and the highest 'x' coordinates of the profile characteristic points. The distance between characteristic points 1 and 8. This can be broken down into: waterside_width : The distance between characteristics points 1 and 4. polderside_width : The distance between characteristics points 4 and 8. Image 1. Base profile properties The geometry of a dike has certain additional characteristics: - crest ( kruin ): The flat part on top of the dike. - berm ( berm ): The flat part between either point 2 and 3 (waterside) or point 6 an 7 (polderside). - slope ( talud ): The (steepness of the) diagonal parts between points 1 and 4 (waterside) or points 5 and 8 (polderside). - ground level ( maaiveld ): The level of the area to the left of point 1 (waterside) or to the right of point 8 (polderside).","title":"Koswat properties"},{"location":"reference/koswat_dike.html#dike-layers","text":"A dike is composed by three layers: Sand, the core layer. Clay, a coating layer. Grass, a (top) coating layer. These layers are wrapped under a KoswatLayersWrapperProtocol instance. At the same time, each layer is an instance of a KoswatLayerProtocol containing the following properties: material_type : Either Sand, Clay or Grass. upper_points : The surface points of the layer. This property can be used to calculate the surface (m 2 ) of a material. outer_geometry : A polygon representing the material layer and the 'wrapped' polygons. For instance, the Clay outer_geometry will also include the Sand material_geometry . material_geometry : A closed polygon containing only the points representing the layer. Using Image 3. Clay layer highlighted as an example, we can map the previous properties: material_type : Clay, the 'in-between' layer. upper_points : Line with the 'orange' points, without 'closing' the polygon, something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0)]. outer_geometry : Closed geometry using the upper points and the 'ground level' ( maaiveld ) points: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (-18, 0) ]. material_geometry : Closed geometry using the upper_points from Clay and the upper_points from the layer below (Sand, green points). Should be something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), (19, 0), (8, 4.75), (0, 4.75), (-14, 0), (-18, 0) ] Image 2. Sand layer highlighted Image 3. Clay layer highlighted Image 4. Grass layer highlighted","title":"Dike layers"},{"location":"reference/koswat_main_workflow.html","text":"Main workflow \u00b6 As described in the user manual , the tool can be used either as a sandbox, where the user has responsibility on how to put together an analysis, or as a command line tool. When using the latter unfortunately we will only have one available call, in this chapter we will breakdown this main workflow so that we can better understand the structure of the rest of the package. First of all, let's write the workflow as a pipeline: CLI call -> Import of ini files -> Run scenarios -> Generate reinforcement profiles -> Calculate reinforcement costs -> Apply measure selection strategy -> Calculate total costs -> Export results Image 1. General Workflow CLI Call \u00b6 This step is very straightforward, the command line will run the method run_analysis , which will initiate the KoswatHandler and start an analysis. Import of ini files \u00b6 This step comprehends of several more steps. Usually, for each of the file imports an internal workflow will happen: File -> Import -> File Object Model -> Build -> Data Object Model This step is summarized by the generation of the KoswatRunSettings object. Run scenarios \u00b6 Each KoswatRunScenarioSettings will run a koswat analysis for a given dike section. To do so, a specific KoswatProfileBase will be created based on the conditions from the KoswatScenario and the surroundings of said dike section. Generate reinforcement profiles \u00b6 All reinforcement profiles will be calculated for the scenario KoswatProfileBase profile. Calculate reinforcement costs \u00b6 For this step, we will be creating a cost report For each of the reinforcement profiles we will calculate their associated costs if they were to be applied at all the available traject points where the surroundings allow it. Apply measure selection strategy \u00b6 Based on the available locations and the reinforcements that can be applied to it, a selection strategy finds which construction should be done at each location based on the strategy's criteria. Calculate total costs \u00b6 Once Koswat knows which measure will be applied to each location, and with the previously calculated reinforcement costs , it will estimate the total meters required of each reinforcement and their total cost in euros (\u20ac). Export results \u00b6 Once the costs reports are generate each of the summaries is exported to a *.csv file whilst the reinforcement profiles 'layers' are also exported into different *.png files.","title":"Main workflow"},{"location":"reference/koswat_main_workflow.html#main-workflow","text":"As described in the user manual , the tool can be used either as a sandbox, where the user has responsibility on how to put together an analysis, or as a command line tool. When using the latter unfortunately we will only have one available call, in this chapter we will breakdown this main workflow so that we can better understand the structure of the rest of the package. First of all, let's write the workflow as a pipeline: CLI call -> Import of ini files -> Run scenarios -> Generate reinforcement profiles -> Calculate reinforcement costs -> Apply measure selection strategy -> Calculate total costs -> Export results Image 1. General Workflow","title":"Main workflow"},{"location":"reference/koswat_main_workflow.html#cli-call","text":"This step is very straightforward, the command line will run the method run_analysis , which will initiate the KoswatHandler and start an analysis.","title":"CLI Call"},{"location":"reference/koswat_main_workflow.html#import-of-ini-files","text":"This step comprehends of several more steps. Usually, for each of the file imports an internal workflow will happen: File -> Import -> File Object Model -> Build -> Data Object Model This step is summarized by the generation of the KoswatRunSettings object.","title":"Import of ini files"},{"location":"reference/koswat_main_workflow.html#run-scenarios","text":"Each KoswatRunScenarioSettings will run a koswat analysis for a given dike section. To do so, a specific KoswatProfileBase will be created based on the conditions from the KoswatScenario and the surroundings of said dike section.","title":"Run scenarios"},{"location":"reference/koswat_main_workflow.html#generate-reinforcement-profiles","text":"All reinforcement profiles will be calculated for the scenario KoswatProfileBase profile.","title":"Generate reinforcement profiles"},{"location":"reference/koswat_main_workflow.html#calculate-reinforcement-costs","text":"For this step, we will be creating a cost report For each of the reinforcement profiles we will calculate their associated costs if they were to be applied at all the available traject points where the surroundings allow it.","title":"Calculate reinforcement costs"},{"location":"reference/koswat_main_workflow.html#apply-measure-selection-strategy","text":"Based on the available locations and the reinforcements that can be applied to it, a selection strategy finds which construction should be done at each location based on the strategy's criteria.","title":"Apply measure selection strategy"},{"location":"reference/koswat_main_workflow.html#calculate-total-costs","text":"Once Koswat knows which measure will be applied to each location, and with the previously calculated reinforcement costs , it will estimate the total meters required of each reinforcement and their total cost in euros (\u20ac).","title":"Calculate total costs"},{"location":"reference/koswat_main_workflow.html#export-results","text":"Once the costs reports are generate each of the summaries is exported to a *.csv file whilst the reinforcement profiles 'layers' are also exported into different *.png files.","title":"Export results"},{"location":"reference/koswat_reinforced_profile.html","text":"Reinforcement profile \u00b6 In koswat we consider a reinforcement profile the result of applying one of the multiple possible reinforcement calculations on an instance of a KoswatProfileBase ( Koswat dike ). This chapter covers the description of a reinforcement profile and its parts. Properties \u00b6 A reinforcement profile implements the ReinforcementProfileProtocol , which is a specialization of the KoswatProfileProtocol with some differences: input_data : Similar to the base profile input_data but instead implements the ReinforcementInputProfileProtocol , a specialization of the ( KoswatInputProfileProtocol ) which depends on the type of reinforcement being applied. old_profile : New property which contains the koswat profile from which the calculation was based on. Possible reinforcements. \u00b6 We have two main different sort of reinfocements which contain also subtypes for said reinforcements: Outside slope reinforcement : Cofferdam ( kistdam ), based on the OutsideSlopeReinforcementProfile . With this reinforcement the outside slope ( buiten talud ) of the dike is impacted. Standard reinforcement : Piping wall ( kwelscherm ), soil ( grondmaatregel profiel ), stability wall ( stabiliteitswand ), vertical piping solution ( verticale piping oplossing ). The previous being based on the StandardReinforcementProfile . A piping wall can be implemented by a cb wall ( cement-bentoniet wand ) and an unanchored sheet pile ( onverankerde damwand ). A stability wall can be implemented by a diaphragm wall ( diepwand ) and an anchored sheet pile ( verankerde damwand ). In addition, the above mentioned reinforcements can also implement their own ReinforcementInputProfileProtocol , which are after all extensions of the KoswatInputProfileBase with extra properties.","title":"Reinforcement profile"},{"location":"reference/koswat_reinforced_profile.html#reinforcement-profile","text":"In koswat we consider a reinforcement profile the result of applying one of the multiple possible reinforcement calculations on an instance of a KoswatProfileBase ( Koswat dike ). This chapter covers the description of a reinforcement profile and its parts.","title":"Reinforcement profile"},{"location":"reference/koswat_reinforced_profile.html#properties","text":"A reinforcement profile implements the ReinforcementProfileProtocol , which is a specialization of the KoswatProfileProtocol with some differences: input_data : Similar to the base profile input_data but instead implements the ReinforcementInputProfileProtocol , a specialization of the ( KoswatInputProfileProtocol ) which depends on the type of reinforcement being applied. old_profile : New property which contains the koswat profile from which the calculation was based on.","title":"Properties"},{"location":"reference/koswat_reinforced_profile.html#possible-reinforcements","text":"We have two main different sort of reinfocements which contain also subtypes for said reinforcements: Outside slope reinforcement : Cofferdam ( kistdam ), based on the OutsideSlopeReinforcementProfile . With this reinforcement the outside slope ( buiten talud ) of the dike is impacted. Standard reinforcement : Piping wall ( kwelscherm ), soil ( grondmaatregel profiel ), stability wall ( stabiliteitswand ), vertical piping solution ( verticale piping oplossing ). The previous being based on the StandardReinforcementProfile . A piping wall can be implemented by a cb wall ( cement-bentoniet wand ) and an unanchored sheet pile ( onverankerde damwand ). A stability wall can be implemented by a diaphragm wall ( diepwand ) and an anchored sheet pile ( verankerde damwand ). In addition, the above mentioned reinforcements can also implement their own ReinforcementInputProfileProtocol , which are after all extensions of the KoswatInputProfileBase with extra properties.","title":"Possible reinforcements."},{"location":"reference/koswat_strategies.html","text":"Strategies \u00b6 Koswat can determine which is the \"best\" reinforcement type for a dike traject based on different selection criteria that we name \"strategies\" ( StrategyProtocol ). A strategy requires a strategy input ( StrategyInput ), this input contains information over which reinforcement types are available at each location as well as what's the minimal buffer ( reinforcement_min_buffer ) and minimal length ( reinforcement_min_length ) for each reinforcement type. By default a strategy is applied as follows: For each point (meter) in the traject, determine which reinforcements can be applied to it. Choose one of the available reinforcements based on the chosen strategy . When no reinforcement is available the most restrictive will be chosen ( CofferDam ). Apply a buffer ( reinforcement_min_buffer ) for each one of the reinforcements. Check if the minimal distance between constructions is met ( reinforcement_min_length ), otherwise change it into one of the reinforcements next to it. Repeat 4 until all reinforcements have enough distance between themselves. Find based on the strategy for infrastructure derived costs , mapped locations ( list[StrategyLocationReinforcement] ) whose reinforcement can be increased into a most restrictive one with total lower costs. Return list of mapped locations ( list[StrategyLocationReinforcement] ). Available strategies \u00b6 Currently the following strategies are implemented: Order based Infrastructure priority , by default the strategy to run during a Koswat analysis. Order based \u00b6 This strategy is the first and default of all defined strategies. Its criteria is based on a pre-defined 'order' of each reinforcement. In steps, it can be seen as: Pre-selection of a location's available reinforcement based on said order, when a location does not have any \"available\" reinforcement, then the last reinforcement's order will be pre-selected. Grouping of all locations by their pre-selected reinforcement. Buffering to each of the groupings. Clustering to the resulting groupings from the previous step. Reinforcement order \u00b6 The reinforcements are ordered based on increasing cost (including surtax) and decreasing width. Reinforcements that are more expensive but are wider or have equal width are skipped (order -1 ). The CofferDamReinforcementProfile will never be skipped and is always the last reinforcement that is applied in case no other reinforcement fits the surroundings. Reinforcement type Profile width Cost with surtax Index SoilReinforcementProfile 10 100 0 VPSReinforcementProfile 20 200 -1 PipingWallReinforcementProfile 10 300 -1 StabilityWallReinforcementProfile 5 400 1 CofferDamReinforcementProfile 0 500 2 Reinforcement grouping \u00b6 We create reinforcement-location \"grouping\" for the whole traject. A grouping represents a reinforcement type that is \"selected\" for a series of continuous locations. This means locations that are next to each other sharing the same measure type ( Type[ReinforcementProfileProtocol] ). Grouping example \u00b6 Simplified representation for a traject with 10 locations. This example is also tested in the tests.strategies.order_strategy.py test file. { \"SoilReinforcementProfile\" : [ \"Location_000\" , \"Location_001\" , \"Location_002\" , ], \"StabilityWallReinforcementProfile\" : [ \"Location_003\" , \"Location_004\" , ], \"SoilReinforcementProfile\" : [ \"Location_005\" , \"Location_006\" , \"Location_007\" , ], \"CofferDamReinforcementProfile\" : [ \"Location_008\" , \"Location_009\" , ], } Reinforcement buffering \u00b6 Given a reinforcement grouping , we will create a dictionary of masks of size NM where N (the keys) is the number of available reinforcement types ( Type[ReinforcementProfileProtocol] ) and M the number of available locations. Note : Masks' values are the position of a reinforcement type in the reinforcement's order list . So a location with CofferDamReinforcementProfile will have a 4 at the mask's position, whilst a SoilReinforcementProfile will have a 0 instead (remember in Python indexing starts with 0). Steps breakdown : Initialize the dictionary masks with all values to -1. Iterate over the groupings list, and for each entry: Select the mask to update using the grouping's reinforcement type (cluster's key). Update the indices representing the grouping's locations (grouping's values) with the matching value for this grouping's key (see previous note ). Add a buffer ( StrategyInput.reinforcement_min_buffer ) by updating the adjacent's positions of this grouping with the same values as in step 1. Merge all masks into a 1-dimensional array where the cell's value is the maximum between the available masks. This is done to prevent that a buffer of a \"stronger\" demanding reinforcement such as CofferDamReinforcementProfile is replaced by a \"weaker\" one. Update the locations with their new associated reinforcement. The resulting mask contains the index of the reinforcement to be applied in the reinforcement's order . Buffering example \u00b6 One simplified example, based on the grouping example , and using a buffer value of \"1\". This example is also tested in the tests.strategies.order_strategy_buffering.py test file. 1. I n i t ialize t he masks based o n t he provided clus ters : { \"SoilReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"VPSReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"PipingWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"StabilityWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"CofferDamReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], } 2. I terate over t he clus ters a n d upda te t he masks' values : { \"SoilReinforcementProfile\" : [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1 ], \"VPSReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"PipingWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"StabilityWallReinforcementProfile\" : [ -1 , -1 , 3 , 3 , 3 , 3 , -1 , -1 , -1 , -1 ], \"CofferDamReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , 4 , 4 , 4 ], } 3. Merge all masks a n d selec t t heir maximum value : [ 0 , 0 , 3 , 3 , 3 , 3 , 0 , 4 , 4 , 4 ] 4. Upda te t he clus ter 's loca t io ns : { \"SoilReinforcementProfile\" : [ \"Location_000\" , \"Location_001\" , ], \"StabilityWallReinforcementProfile\" : [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , ], \"SoilReinforcementProfile\" : [ \"Location_006\" , ], \"CofferDamReinforcementProfile\" : [ \"Location_007\" , \"Location_008\" , \"Location_009\" , ], } Reinforcement clustering \u00b6 Given a reinforcement grouping , ideally done after applying buffering , we will now proceed to change the pre-selected reinforcement of all those groupings that contain less locations than required by the describing property. We do this by updating their type with the one of a \"stronger\" adjacent grouping, on this section called \"clusters\". These clusters are internally represented by the class OrderCluster . The strategy here is to detect non-compliant reinforcement-location clusters and replace their selected reinforcement type with the \"least strong\" of its adjacent clusters. We do this iteratively, so we first target the lowest type of reinforcements ( SoilReinforcementProfile ) and we move up until the first to the last (the last one cannot be further strengthened). Conditions : We define a non-compliant cluster as a cluster that does not contain as many locations as defined by the minimal length requirement ( reinforcement_min_length ). We also define a non-compliant exception when a cluster does not meet said requirement but the adjacent clusters are of a lower reinforcement type. Therefore retaining their initial reinforcement type. The first and last clusters, are always considered compliant . Therefore they retain their initial reinforcement type. Clusters whose reinforcement type is placed the last in the strategy's order , are skipped and always considered compliant , as they cannot be further strengthened. Steps breakdown : Generate a list of all available unmerged clusters. For each reinforcement type target-reinforcement , in the strategy order: Get the current non-compliant clusters For each non-compliant target-reinforcement cluster : Check if its indeed not compliant. Otherwise move to the next cluster. Get a stronger cluster among the neighbors. Selects the neighbor with the \"weakest\", yet greater than the actual, reinforcement type value. If both neighbors are \"weaker\" than the current reinforcement type, then it is considered an \"exception\" as it cannot be further strengthened. We therefore move to the next non-compliant cluster. Move the current cluster's locations to the stronger reinforcement cluster. Remove the cluster from the \"available clusters\" list as it is integrated in step 2.2.3. Clustering example \u00b6 One simplified example, based on the buffering example , and using a minimal distance of \"5\". This example is also tested in the tests.strategies.order_strategy_clustering.py test file. 1. Lis t o f u n merged clus ters : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" ,] ) , ( 0 , [ \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) } 2. I terate over each rei nf orceme nt t ype : 2.1. Targe t is \"SoilReinforcementProfile\" (idx= 0 ) , n o n - complia nt clus ters { ( 0 , [ \"Location_006\" ,] ) } 2.1.1. Le n g t h = 1. 2.1.2. Ge t a s tr o n ger ne ighbor , - Le ft - ne ighbor rei nf orceme nt t ype = 3 , - Righ t - ne ighbor rei nf orceme nt t ype = 4 , - Le ft - ne ighbor is selec te d. 2.1.3. Move loca t io ns t o s tr o n ger ne ighbor. { ( 2 , [ \"Location_002\" , ... , \"Location_006\" ,] ) , ( 0 , [ \"Location_006\" ,] ) , } 2.1.4. Remove t he curre nt clus ter fr om t he available lis t . 2.2. Targe t is \"PipingWallReinforcementProfile\" (idx= 2 ) , - All clus ters are complia nt a t t his poi nt . 2.3. Targe t is \"StabilityWallReinforcementProfile\" (idx= 3 ) , - All clus ters are complia nt a t t his poi nt . 2.4. \"CofferDamReinforcementProfile\" (idx= 4 ) - Las t rei nf orceme nt pro f ile t ype , t here f ore t he s tr o n ges t . Resul t i n g clus ter : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } Infrastructure priority \u00b6 DEFAULT STRATEGY This strategy checks whether the clusters resulting from the order based strategy can change their selected reinforcement to one with cheaper costs. These costs are extracted from the cost report and relate to the reinforcement profile costs (dike's materials for the required space) and the possible infrastructure costs . In steps, this strategy can be broke down as: Steps breakdown : Assignment of order based clusters , Cluster options evaluation, Common available measures cost calculation, Cheapest option selection, Update reinforcement selection with selected option. Cluster options \u00b6 For an optimal assignment of a new reinforcement profile, we make use of \"subclusters\". These subclusters are contiguous subsets from an order based cluster and have the minimal required length ( StrategyInput.reinforcement_min_cluster ). The logic for this section can be found in InfraPriorityStrategy.generate_subcluster_options . For each of original the clusters, multiple combinations of subclusters are possible. We refer to them as \" cluster option \" ( InfraClusterOption ) . We can already discard creating subclusters when the size of the original cluster is less than twice the required minimal length. So for a minimal length of 2 locations, you require a cluster of at least 4 locations to generate subclusters. Conditions : We only create subclusters when the cluster's original size is, at least, twice the required minimal cluster's length. We estimate the cluster's minimal length to be at least twice the size of the buffer so: min_cluster_length = (2 * reinforcement_min_buffer) + 1 . We create subclusters based on the immediate results of the order based strategy . We do not try to combine or create new clusters based on a \"greedier\" strategy. Cluster option example \u00b6 For example, given the results of the clustering example we can calculate the options for the clusters for a required minimal length of 2 : List of clusters: { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } Options for cluster {(0, [\"Location_000\",\"Location_001\",])} - Valid op t io ns : ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) Options for cluster {(3, [\"Location_002\",\"Location_003\", \"Location_004\",\"Location_005\", \"Location_006\",])} - Valid : - {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" , \"Location_006\" ]}, - {[ \"Location_002\" , \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]} - I n valid : - f irs t subclus ter 's size is less t ha n required : {[ \"Location_002\" ], [ \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]} - las t subclus ter 's size is less t ha n required : {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" ], [ \"Location_006\" ]}, - seco n d subclus ter 's size is less t ha n required : {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]}, - a n d so o n ... Options for cluster {(4, [\"Location_007\",\"Location_008\",\"Location_009\",]),} - Valid : - {[ \"Location_007\" , \"Location_008\" , \"Location_009\" ,]} - I n valid : - f irs t subclus ter 's size is less t ha n required : {[ \"Location_007\" ], [ \"Location_008\" , \"Location_009\" ]} - las t subclus ter 's size is less t ha n required : {[ \"Location_007\" , \"Location_008\" ], [ \"Location_009\" ]} - a n d so o n ... Cluster common available measures' cost \u00b6 Once we have calculated a cluster's option we can determine whether this cluster should be consider as a valid one. This estimation is based on the cheapest reinforcement's cost , and to get this value we first need to know which reinforcements are available at all the locations of this option. We will store this value in the InfraClusterOption.cluster_costs . In the current implementation, these costs are added to the InfraClusterOption together with the cluster's data ( list[InfraCluster] ). Conditions : A \"viable\" cluster option must be cheaper than the order's cluster and has the cluster's minimal length. We consider \"minimal costs\" or \"lower costs\" as the lowest cost of applying a certain reinforcement type to a given subcluster. Common available measures' cost example \u00b6 Following the options example we can estimate some fictional costs based on the following tables (if a type / location is not mentioned, then assume its cost is zero ( 0 )): Index Reinforcement type base cost 0 Soil reinforcement 42 1 Vertical Piping Solution 420 2 Piping Wall 4.200 3 Stability Wall 42.000 4 Cofferdam 420.000 Location Reinforcement indices Infrastructure cost Location_000 0, 1 4.200.000 Location_005 0, 1, 2, 3 4.200.000 We already know that only the second cluster can generate subclusters, therefore different valid options, so we will use said subcluster's options for the example. 1. De ter mi ne curre nt cos t : - { 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ]} - Base cos ts = 5 * 42.000 = 210.000 - I nfra cos ts = ( 1 ) * 4.200.000 = 4.200.000 - To tal cos ts = 4.410.000 2. Calcula te cos ts f or f irs t op t io n : - { ( 3 , [ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" , \"Location_006\" ] ) }, 1. Firs t subclus ter 's commo n measures : - S ta bili t y Wall (curre nt ) : - Base cos ts = 2 * 42.000 = 84.000 - I nfra cos ts = 0 - To tal cos ts = 42.000 - Co ffer dam : - Base cos ts = 2 * 420.000 = 840.000 - I nfra cos ts = 0 - To tal cos ts = 840.000 - The curre nt rei nf oceme nt is cheaper 2. Seco n d subclus ter 's commo n measures : - S ta bili t y Wall (curre nt ) : - Base cos ts = 3 * 42.000 = 126.000 - I nfra cos ts = ( 1 ) * 4.200.000 = 4.200.000 - To tal cos ts = 4.326.000 - Co ffer dam : - Base cos ts = 3 * 420.000 = 1.260.000 - I nfra cos ts = 0 - To tal cos ts = 1.260.000 - Co ffer dam will be cheaper. 3. Subclus ter 's bes t op t io n is cheaper t ha n curre nt : - { ( 3 , [ \"Location_002\" , \"Location_003\" ] ) , ( 4 , [ \"Location_004\" , \"Location_005\" , \"Location_006\" ] ) } - To tal cos t = 42.000 + 1.260.000 = 1.302.000 - Selec te d as op t io n . 3. Calcula te cos ts f or seco n d op t io n : - { 3 , ( [ \"Location_002\" , \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ] ) } 1. Firs t sublus ter 's commo n measures - S ta bili t y Wall (curre nt ) : - Base cos ts = 3 * 42.000 = 126.000 - I nfra cos ts = 0 - To tal cos ts = 126.000 - Co ffer dam : - Base cos ts = 3 * 420.000 = 1.260.000 - I nfra cos ts = 0 - To tal cos ts = 1.260.000 - The curre nt rei nf oceme nt is cheaper 2. Seco n d sublus ter 's commo n measures - S ta bili t y Wall (curre nt ) : - Base cos ts = 2 * 42.000 = 84.000 - I nfra cos ts = 0 - To tal cos ts = 84.000 - Co ffer dam : - Base cos ts = 2 * 420.000 = 840.000 - I nfra cos ts = 0 - To tal cos ts = 840.000 - Co ffer dam is cheaper 3. Subclus ter 's bes t op t io n is cheaper t ha n selec t io n : - { ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" ] ) , ( 4 , [ \"Location_005\" , \"Location_006\" ] ) } - To tal cos t = 126.000 + 840.000 = 966.000 - Selec te d as op t io n . 4. Upda te loca t io ns ' selec te d rei nf orceme nt : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" ,] ) , ( 4 , [ \"Location_005\" , \"Location_006\" , \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } In this example we can therefore demonstrate the cost reduction. The last column represents the difference (positive means saved money): O.S. = Order strategy I.S. = Infrastructure priority strategy Location (O.S.) reinforcement (O.S.) cost (I.S.) reinforcement (I.S.) cost Difference Total ---- 6.090.084 ---- 2.226.840 +3.863.244 Location_000 Soil reinforcement 4.200.042 Piping Wall 420 +4.199.622 Location_001 Soil reinforcement 42 Piping Wall 420 -378 Location_002 Stability Wall 42.000 Stability Wall 42.000 0 Location_003 Stability Wall 42.000 Stability Wall 42.000 0 Location_004 Stability Wall 42.000 Stability Wall 42.000 0 Location_005 Stability Wall 462.000 Cofferdam 420.000 +42000 Location_006 Stability Wall 42.000 Cofferdam 420.000 -378000 Location_007 Cofferdam 420.000 Cofferdam 420.000 0 Location_008 Cofferdam 420.000 Cofferdam 420.000 0 Location_009 Cofferdam 420.000 Cofferdam 420.000 0 Infrastructure priority (old approach) example \u00b6 Important! This example is based on the first approach of this strategy and its steps might differ from the current solution. We left this example as it can help understanding the basic concepts of the strategy. We will start by defining some unrealistic costs per reinforcement type for all locations* such as. For a more realistic scenario check the subclustering example : Index Reinforcement type base cost infra cost total cost 0 Soil reinforcement 42 420.000 420.042 1 Vertical Piping Solution 420 420.000 420.420 2 Piping Wall 4200 0 4200 3 Stability Wall 42.000 420.000 462.000 4 Cofferdam 420.000 0 420.000 Important! For example purposes we are applying the same infrastructure costs to all the locations. |However, in a real case these costs would vary per location (and per reinforcement type). So we can determine the cluster's reinforcement costs as (total cost) * N locations Based on this data Piping Wall will be chosen unless any of the points in the cluster cannot apply it due to obstacles or other constraints, in which case it would end up settling for a Cofferdam reinforcement. Let's see now the strategy steps using the results from the clustering example : 1. Lis t o f clus ters : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } 2. I terate over each clus ter : 2.1. Firs t clus ter is : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) } 2.1.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 420042 ) * 2 = 840084 ` 2.1.2. Ge t cheaper commo n available measures : - Soil Rei nf orceme nt , (idx= 0 ) , - [ Discard ] Curre nt selec t io n . - Ver t ical Pipi n g Solu t io n , (idx= 1 ) , - Cos ts = `( 420.420 ) * 2 = 840.840 ` - [ Discard ] Cos ts are higher t ha n i n i t ial s tate . - Pipi n g Wall , (idx= 2 ) , - Cos ts = `( 4.200 + 0 ) * 2 = 8.400 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate . - S ta bili t y Wall , (idx= 3 ) , - Cos ts = `( 462.000 ) * 2 = 924.000 ` - [ Discard ] Cos ts are higher t ha n i n i t ial s tate . - Co ffer dam , (idx= 3 ) , - Cos ts = `( 420.000 ) * 2 = 840.000 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate , keep. 2.1.3. Se t t he cheapes t commo n available measure per clus ter : - Pipi n g wall < Co ffer dam < Soil rei nf orceme nt (curre nt ) - Pipi n g wall is t he ne w rei nf orceme nt f or t his clus ter . - Resul t : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) } 2.2. Seco n d clus ter is : { ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) } 2.3.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 462.000 ) * 5 = 2.310.000 ` 2.3.2. Ge t cheaper commo n available measures. - Soil Rei nf orceme nt , (idx= 0 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - Ver t ical Pipi n g Solu t io n , (idx= 1 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - Pipi n g Wall , (idx= 2 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - S ta bili t y Wall , (idx= 3 ) , - [ Discard ] Curre nt selec t io n . - Co ffer dam , (idx= 3 ) , - Cos ts = `( 420.000 ) * 5 = 2.100.000 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate . 2.3.3. Se t t he cheapes t commo n available measure per clus ter : - Co ffer dam < S ta bili t y wall - Co ffer dam is t he ne w rei nf orceme nt f or t his clus ter . - Resul t : { ( 4 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) } 2.3. Third clus ter is : { ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) }} 2.3.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 420.000 ) * 3 = 1.260.000 ` 2.3.2. Ge t cheaper commo n available measures. - Co ffer dam , (idx= 4 ) , - Curre nt selec t io n . 2.3.3. Se t t he cheapes t commo n available measure per clus ter : - O nl y co ffer dam available , - No furt her ac t io n . - Resul t : { ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) } 2.4. Resul t i n g clus ters : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 4 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" , \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } With this, we went from: Initial costs: (420.042) * 2 + (462.000) * 5 + (420.000) * 3 = 4.410.084 , to Final costs: (4.200) * 2 + (420.000) * 8 = 3.368.400 Which would amount to a total save of 1.041.684\u20ac","title":"Strategies"},{"location":"reference/koswat_strategies.html#strategies","text":"Koswat can determine which is the \"best\" reinforcement type for a dike traject based on different selection criteria that we name \"strategies\" ( StrategyProtocol ). A strategy requires a strategy input ( StrategyInput ), this input contains information over which reinforcement types are available at each location as well as what's the minimal buffer ( reinforcement_min_buffer ) and minimal length ( reinforcement_min_length ) for each reinforcement type. By default a strategy is applied as follows: For each point (meter) in the traject, determine which reinforcements can be applied to it. Choose one of the available reinforcements based on the chosen strategy . When no reinforcement is available the most restrictive will be chosen ( CofferDam ). Apply a buffer ( reinforcement_min_buffer ) for each one of the reinforcements. Check if the minimal distance between constructions is met ( reinforcement_min_length ), otherwise change it into one of the reinforcements next to it. Repeat 4 until all reinforcements have enough distance between themselves. Find based on the strategy for infrastructure derived costs , mapped locations ( list[StrategyLocationReinforcement] ) whose reinforcement can be increased into a most restrictive one with total lower costs. Return list of mapped locations ( list[StrategyLocationReinforcement] ).","title":"Strategies"},{"location":"reference/koswat_strategies.html#available-strategies","text":"Currently the following strategies are implemented: Order based Infrastructure priority , by default the strategy to run during a Koswat analysis.","title":"Available strategies"},{"location":"reference/koswat_strategies.html#order-based","text":"This strategy is the first and default of all defined strategies. Its criteria is based on a pre-defined 'order' of each reinforcement. In steps, it can be seen as: Pre-selection of a location's available reinforcement based on said order, when a location does not have any \"available\" reinforcement, then the last reinforcement's order will be pre-selected. Grouping of all locations by their pre-selected reinforcement. Buffering to each of the groupings. Clustering to the resulting groupings from the previous step.","title":"Order based"},{"location":"reference/koswat_strategies.html#reinforcement-order","text":"The reinforcements are ordered based on increasing cost (including surtax) and decreasing width. Reinforcements that are more expensive but are wider or have equal width are skipped (order -1 ). The CofferDamReinforcementProfile will never be skipped and is always the last reinforcement that is applied in case no other reinforcement fits the surroundings. Reinforcement type Profile width Cost with surtax Index SoilReinforcementProfile 10 100 0 VPSReinforcementProfile 20 200 -1 PipingWallReinforcementProfile 10 300 -1 StabilityWallReinforcementProfile 5 400 1 CofferDamReinforcementProfile 0 500 2","title":"Reinforcement order"},{"location":"reference/koswat_strategies.html#reinforcement-grouping","text":"We create reinforcement-location \"grouping\" for the whole traject. A grouping represents a reinforcement type that is \"selected\" for a series of continuous locations. This means locations that are next to each other sharing the same measure type ( Type[ReinforcementProfileProtocol] ).","title":"Reinforcement grouping"},{"location":"reference/koswat_strategies.html#grouping-example","text":"Simplified representation for a traject with 10 locations. This example is also tested in the tests.strategies.order_strategy.py test file. { \"SoilReinforcementProfile\" : [ \"Location_000\" , \"Location_001\" , \"Location_002\" , ], \"StabilityWallReinforcementProfile\" : [ \"Location_003\" , \"Location_004\" , ], \"SoilReinforcementProfile\" : [ \"Location_005\" , \"Location_006\" , \"Location_007\" , ], \"CofferDamReinforcementProfile\" : [ \"Location_008\" , \"Location_009\" , ], }","title":"Grouping example"},{"location":"reference/koswat_strategies.html#reinforcement-buffering","text":"Given a reinforcement grouping , we will create a dictionary of masks of size NM where N (the keys) is the number of available reinforcement types ( Type[ReinforcementProfileProtocol] ) and M the number of available locations. Note : Masks' values are the position of a reinforcement type in the reinforcement's order list . So a location with CofferDamReinforcementProfile will have a 4 at the mask's position, whilst a SoilReinforcementProfile will have a 0 instead (remember in Python indexing starts with 0). Steps breakdown : Initialize the dictionary masks with all values to -1. Iterate over the groupings list, and for each entry: Select the mask to update using the grouping's reinforcement type (cluster's key). Update the indices representing the grouping's locations (grouping's values) with the matching value for this grouping's key (see previous note ). Add a buffer ( StrategyInput.reinforcement_min_buffer ) by updating the adjacent's positions of this grouping with the same values as in step 1. Merge all masks into a 1-dimensional array where the cell's value is the maximum between the available masks. This is done to prevent that a buffer of a \"stronger\" demanding reinforcement such as CofferDamReinforcementProfile is replaced by a \"weaker\" one. Update the locations with their new associated reinforcement. The resulting mask contains the index of the reinforcement to be applied in the reinforcement's order .","title":"Reinforcement buffering"},{"location":"reference/koswat_strategies.html#buffering-example","text":"One simplified example, based on the grouping example , and using a buffer value of \"1\". This example is also tested in the tests.strategies.order_strategy_buffering.py test file. 1. I n i t ialize t he masks based o n t he provided clus ters : { \"SoilReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"VPSReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"PipingWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"StabilityWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"CofferDamReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], } 2. I terate over t he clus ters a n d upda te t he masks' values : { \"SoilReinforcementProfile\" : [ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , -1 ], \"VPSReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"PipingWallReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ], \"StabilityWallReinforcementProfile\" : [ -1 , -1 , 3 , 3 , 3 , 3 , -1 , -1 , -1 , -1 ], \"CofferDamReinforcementProfile\" : [ -1 , -1 , -1 , -1 , -1 , -1 , -1 , 4 , 4 , 4 ], } 3. Merge all masks a n d selec t t heir maximum value : [ 0 , 0 , 3 , 3 , 3 , 3 , 0 , 4 , 4 , 4 ] 4. Upda te t he clus ter 's loca t io ns : { \"SoilReinforcementProfile\" : [ \"Location_000\" , \"Location_001\" , ], \"StabilityWallReinforcementProfile\" : [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , ], \"SoilReinforcementProfile\" : [ \"Location_006\" , ], \"CofferDamReinforcementProfile\" : [ \"Location_007\" , \"Location_008\" , \"Location_009\" , ], }","title":"Buffering example"},{"location":"reference/koswat_strategies.html#reinforcement-clustering","text":"Given a reinforcement grouping , ideally done after applying buffering , we will now proceed to change the pre-selected reinforcement of all those groupings that contain less locations than required by the describing property. We do this by updating their type with the one of a \"stronger\" adjacent grouping, on this section called \"clusters\". These clusters are internally represented by the class OrderCluster . The strategy here is to detect non-compliant reinforcement-location clusters and replace their selected reinforcement type with the \"least strong\" of its adjacent clusters. We do this iteratively, so we first target the lowest type of reinforcements ( SoilReinforcementProfile ) and we move up until the first to the last (the last one cannot be further strengthened). Conditions : We define a non-compliant cluster as a cluster that does not contain as many locations as defined by the minimal length requirement ( reinforcement_min_length ). We also define a non-compliant exception when a cluster does not meet said requirement but the adjacent clusters are of a lower reinforcement type. Therefore retaining their initial reinforcement type. The first and last clusters, are always considered compliant . Therefore they retain their initial reinforcement type. Clusters whose reinforcement type is placed the last in the strategy's order , are skipped and always considered compliant , as they cannot be further strengthened. Steps breakdown : Generate a list of all available unmerged clusters. For each reinforcement type target-reinforcement , in the strategy order: Get the current non-compliant clusters For each non-compliant target-reinforcement cluster : Check if its indeed not compliant. Otherwise move to the next cluster. Get a stronger cluster among the neighbors. Selects the neighbor with the \"weakest\", yet greater than the actual, reinforcement type value. If both neighbors are \"weaker\" than the current reinforcement type, then it is considered an \"exception\" as it cannot be further strengthened. We therefore move to the next non-compliant cluster. Move the current cluster's locations to the stronger reinforcement cluster. Remove the cluster from the \"available clusters\" list as it is integrated in step 2.2.3.","title":"Reinforcement clustering"},{"location":"reference/koswat_strategies.html#clustering-example","text":"One simplified example, based on the buffering example , and using a minimal distance of \"5\". This example is also tested in the tests.strategies.order_strategy_clustering.py test file. 1. Lis t o f u n merged clus ters : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" ,] ) , ( 0 , [ \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) } 2. I terate over each rei nf orceme nt t ype : 2.1. Targe t is \"SoilReinforcementProfile\" (idx= 0 ) , n o n - complia nt clus ters { ( 0 , [ \"Location_006\" ,] ) } 2.1.1. Le n g t h = 1. 2.1.2. Ge t a s tr o n ger ne ighbor , - Le ft - ne ighbor rei nf orceme nt t ype = 3 , - Righ t - ne ighbor rei nf orceme nt t ype = 4 , - Le ft - ne ighbor is selec te d. 2.1.3. Move loca t io ns t o s tr o n ger ne ighbor. { ( 2 , [ \"Location_002\" , ... , \"Location_006\" ,] ) , ( 0 , [ \"Location_006\" ,] ) , } 2.1.4. Remove t he curre nt clus ter fr om t he available lis t . 2.2. Targe t is \"PipingWallReinforcementProfile\" (idx= 2 ) , - All clus ters are complia nt a t t his poi nt . 2.3. Targe t is \"StabilityWallReinforcementProfile\" (idx= 3 ) , - All clus ters are complia nt a t t his poi nt . 2.4. \"CofferDamReinforcementProfile\" (idx= 4 ) - Las t rei nf orceme nt pro f ile t ype , t here f ore t he s tr o n ges t . Resul t i n g clus ter : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , }","title":"Clustering example"},{"location":"reference/koswat_strategies.html#infrastructure-priority","text":"DEFAULT STRATEGY This strategy checks whether the clusters resulting from the order based strategy can change their selected reinforcement to one with cheaper costs. These costs are extracted from the cost report and relate to the reinforcement profile costs (dike's materials for the required space) and the possible infrastructure costs . In steps, this strategy can be broke down as: Steps breakdown : Assignment of order based clusters , Cluster options evaluation, Common available measures cost calculation, Cheapest option selection, Update reinforcement selection with selected option.","title":"Infrastructure priority"},{"location":"reference/koswat_strategies.html#cluster-options","text":"For an optimal assignment of a new reinforcement profile, we make use of \"subclusters\". These subclusters are contiguous subsets from an order based cluster and have the minimal required length ( StrategyInput.reinforcement_min_cluster ). The logic for this section can be found in InfraPriorityStrategy.generate_subcluster_options . For each of original the clusters, multiple combinations of subclusters are possible. We refer to them as \" cluster option \" ( InfraClusterOption ) . We can already discard creating subclusters when the size of the original cluster is less than twice the required minimal length. So for a minimal length of 2 locations, you require a cluster of at least 4 locations to generate subclusters. Conditions : We only create subclusters when the cluster's original size is, at least, twice the required minimal cluster's length. We estimate the cluster's minimal length to be at least twice the size of the buffer so: min_cluster_length = (2 * reinforcement_min_buffer) + 1 . We create subclusters based on the immediate results of the order based strategy . We do not try to combine or create new clusters based on a \"greedier\" strategy.","title":"Cluster options"},{"location":"reference/koswat_strategies.html#cluster-option-example","text":"For example, given the results of the clustering example we can calculate the options for the clusters for a required minimal length of 2 : List of clusters: { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } Options for cluster {(0, [\"Location_000\",\"Location_001\",])} - Valid op t io ns : ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) Options for cluster {(3, [\"Location_002\",\"Location_003\", \"Location_004\",\"Location_005\", \"Location_006\",])} - Valid : - {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" , \"Location_006\" ]}, - {[ \"Location_002\" , \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]} - I n valid : - f irs t subclus ter 's size is less t ha n required : {[ \"Location_002\" ], [ \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]} - las t subclus ter 's size is less t ha n required : {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" ], [ \"Location_006\" ]}, - seco n d subclus ter 's size is less t ha n required : {[ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ]}, - a n d so o n ... Options for cluster {(4, [\"Location_007\",\"Location_008\",\"Location_009\",]),} - Valid : - {[ \"Location_007\" , \"Location_008\" , \"Location_009\" ,]} - I n valid : - f irs t subclus ter 's size is less t ha n required : {[ \"Location_007\" ], [ \"Location_008\" , \"Location_009\" ]} - las t subclus ter 's size is less t ha n required : {[ \"Location_007\" , \"Location_008\" ], [ \"Location_009\" ]} - a n d so o n ...","title":"Cluster option example"},{"location":"reference/koswat_strategies.html#cluster-common-available-measures-cost","text":"Once we have calculated a cluster's option we can determine whether this cluster should be consider as a valid one. This estimation is based on the cheapest reinforcement's cost , and to get this value we first need to know which reinforcements are available at all the locations of this option. We will store this value in the InfraClusterOption.cluster_costs . In the current implementation, these costs are added to the InfraClusterOption together with the cluster's data ( list[InfraCluster] ). Conditions : A \"viable\" cluster option must be cheaper than the order's cluster and has the cluster's minimal length. We consider \"minimal costs\" or \"lower costs\" as the lowest cost of applying a certain reinforcement type to a given subcluster.","title":"Cluster common available measures' cost"},{"location":"reference/koswat_strategies.html#common-available-measures-cost-example","text":"Following the options example we can estimate some fictional costs based on the following tables (if a type / location is not mentioned, then assume its cost is zero ( 0 )): Index Reinforcement type base cost 0 Soil reinforcement 42 1 Vertical Piping Solution 420 2 Piping Wall 4.200 3 Stability Wall 42.000 4 Cofferdam 420.000 Location Reinforcement indices Infrastructure cost Location_000 0, 1 4.200.000 Location_005 0, 1, 2, 3 4.200.000 We already know that only the second cluster can generate subclusters, therefore different valid options, so we will use said subcluster's options for the example. 1. De ter mi ne curre nt cos t : - { 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ]} - Base cos ts = 5 * 42.000 = 210.000 - I nfra cos ts = ( 1 ) * 4.200.000 = 4.200.000 - To tal cos ts = 4.410.000 2. Calcula te cos ts f or f irs t op t io n : - { ( 3 , [ \"Location_002\" , \"Location_003\" ], [ \"Location_004\" , \"Location_005\" , \"Location_006\" ] ) }, 1. Firs t subclus ter 's commo n measures : - S ta bili t y Wall (curre nt ) : - Base cos ts = 2 * 42.000 = 84.000 - I nfra cos ts = 0 - To tal cos ts = 42.000 - Co ffer dam : - Base cos ts = 2 * 420.000 = 840.000 - I nfra cos ts = 0 - To tal cos ts = 840.000 - The curre nt rei nf oceme nt is cheaper 2. Seco n d subclus ter 's commo n measures : - S ta bili t y Wall (curre nt ) : - Base cos ts = 3 * 42.000 = 126.000 - I nfra cos ts = ( 1 ) * 4.200.000 = 4.200.000 - To tal cos ts = 4.326.000 - Co ffer dam : - Base cos ts = 3 * 420.000 = 1.260.000 - I nfra cos ts = 0 - To tal cos ts = 1.260.000 - Co ffer dam will be cheaper. 3. Subclus ter 's bes t op t io n is cheaper t ha n curre nt : - { ( 3 , [ \"Location_002\" , \"Location_003\" ] ) , ( 4 , [ \"Location_004\" , \"Location_005\" , \"Location_006\" ] ) } - To tal cos t = 42.000 + 1.260.000 = 1.302.000 - Selec te d as op t io n . 3. Calcula te cos ts f or seco n d op t io n : - { 3 , ( [ \"Location_002\" , \"Location_003\" , \"Location_004\" ], [ \"Location_005\" , \"Location_006\" ] ) } 1. Firs t sublus ter 's commo n measures - S ta bili t y Wall (curre nt ) : - Base cos ts = 3 * 42.000 = 126.000 - I nfra cos ts = 0 - To tal cos ts = 126.000 - Co ffer dam : - Base cos ts = 3 * 420.000 = 1.260.000 - I nfra cos ts = 0 - To tal cos ts = 1.260.000 - The curre nt rei nf oceme nt is cheaper 2. Seco n d sublus ter 's commo n measures - S ta bili t y Wall (curre nt ) : - Base cos ts = 2 * 42.000 = 84.000 - I nfra cos ts = 0 - To tal cos ts = 84.000 - Co ffer dam : - Base cos ts = 2 * 420.000 = 840.000 - I nfra cos ts = 0 - To tal cos ts = 840.000 - Co ffer dam is cheaper 3. Subclus ter 's bes t op t io n is cheaper t ha n selec t io n : - { ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" ] ) , ( 4 , [ \"Location_005\" , \"Location_006\" ] ) } - To tal cos t = 126.000 + 840.000 = 966.000 - Selec te d as op t io n . 4. Upda te loca t io ns ' selec te d rei nf orceme nt : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" ,] ) , ( 4 , [ \"Location_005\" , \"Location_006\" , \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } In this example we can therefore demonstrate the cost reduction. The last column represents the difference (positive means saved money): O.S. = Order strategy I.S. = Infrastructure priority strategy Location (O.S.) reinforcement (O.S.) cost (I.S.) reinforcement (I.S.) cost Difference Total ---- 6.090.084 ---- 2.226.840 +3.863.244 Location_000 Soil reinforcement 4.200.042 Piping Wall 420 +4.199.622 Location_001 Soil reinforcement 42 Piping Wall 420 -378 Location_002 Stability Wall 42.000 Stability Wall 42.000 0 Location_003 Stability Wall 42.000 Stability Wall 42.000 0 Location_004 Stability Wall 42.000 Stability Wall 42.000 0 Location_005 Stability Wall 462.000 Cofferdam 420.000 +42000 Location_006 Stability Wall 42.000 Cofferdam 420.000 -378000 Location_007 Cofferdam 420.000 Cofferdam 420.000 0 Location_008 Cofferdam 420.000 Cofferdam 420.000 0 Location_009 Cofferdam 420.000 Cofferdam 420.000 0","title":"Common available measures' cost example"},{"location":"reference/koswat_strategies.html#infrastructure-priority-old-approach-example","text":"Important! This example is based on the first approach of this strategy and its steps might differ from the current solution. We left this example as it can help understanding the basic concepts of the strategy. We will start by defining some unrealistic costs per reinforcement type for all locations* such as. For a more realistic scenario check the subclustering example : Index Reinforcement type base cost infra cost total cost 0 Soil reinforcement 42 420.000 420.042 1 Vertical Piping Solution 420 420.000 420.420 2 Piping Wall 4200 0 4200 3 Stability Wall 42.000 420.000 462.000 4 Cofferdam 420.000 0 420.000 Important! For example purposes we are applying the same infrastructure costs to all the locations. |However, in a real case these costs would vary per location (and per reinforcement type). So we can determine the cluster's reinforcement costs as (total cost) * N locations Based on this data Piping Wall will be chosen unless any of the points in the cluster cannot apply it due to obstacles or other constraints, in which case it would end up settling for a Cofferdam reinforcement. Let's see now the strategy steps using the results from the clustering example : 1. Lis t o f clus ters : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) , ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } 2. I terate over each clus ter : 2.1. Firs t clus ter is : { ( 0 , [ \"Location_000\" , \"Location_001\" ,] ) } 2.1.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 420042 ) * 2 = 840084 ` 2.1.2. Ge t cheaper commo n available measures : - Soil Rei nf orceme nt , (idx= 0 ) , - [ Discard ] Curre nt selec t io n . - Ver t ical Pipi n g Solu t io n , (idx= 1 ) , - Cos ts = `( 420.420 ) * 2 = 840.840 ` - [ Discard ] Cos ts are higher t ha n i n i t ial s tate . - Pipi n g Wall , (idx= 2 ) , - Cos ts = `( 4.200 + 0 ) * 2 = 8.400 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate . - S ta bili t y Wall , (idx= 3 ) , - Cos ts = `( 462.000 ) * 2 = 924.000 ` - [ Discard ] Cos ts are higher t ha n i n i t ial s tate . - Co ffer dam , (idx= 3 ) , - Cos ts = `( 420.000 ) * 2 = 840.000 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate , keep. 2.1.3. Se t t he cheapes t commo n available measure per clus ter : - Pipi n g wall < Co ffer dam < Soil rei nf orceme nt (curre nt ) - Pipi n g wall is t he ne w rei nf orceme nt f or t his clus ter . - Resul t : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) } 2.2. Seco n d clus ter is : { ( 3 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) } 2.3.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 462.000 ) * 5 = 2.310.000 ` 2.3.2. Ge t cheaper commo n available measures. - Soil Rei nf orceme nt , (idx= 0 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - Ver t ical Pipi n g Solu t io n , (idx= 1 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - Pipi n g Wall , (idx= 2 ) , - [ Discard ] No t prese nt a t \"Location_003\" , \"Location_004\" . - S ta bili t y Wall , (idx= 3 ) , - [ Discard ] Curre nt selec t io n . - Co ffer dam , (idx= 3 ) , - Cos ts = `( 420.000 ) * 5 = 2.100.000 ` - [ Keep ] Cos ts are cheaper t ha n t he i n i t ial s tate . 2.3.3. Se t t he cheapes t commo n available measure per clus ter : - Co ffer dam < S ta bili t y wall - Co ffer dam is t he ne w rei nf orceme nt f or t his clus ter . - Resul t : { ( 4 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" ,] ) } 2.3. Third clus ter is : { ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) }} 2.3.1. Ge t t he curre nt cos t o f usi n g t his clus ter . - To tal cos ts * N loca t io ns = `( 420.000 ) * 3 = 1.260.000 ` 2.3.2. Ge t cheaper commo n available measures. - Co ffer dam , (idx= 4 ) , - Curre nt selec t io n . 2.3.3. Se t t he cheapes t commo n available measure per clus ter : - O nl y co ffer dam available , - No furt her ac t io n . - Resul t : { ( 4 , [ \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) } 2.4. Resul t i n g clus ters : { ( 2 , [ \"Location_000\" , \"Location_001\" ,] ) , ( 4 , [ \"Location_002\" , \"Location_003\" , \"Location_004\" , \"Location_005\" , \"Location_006\" , \"Location_007\" , \"Location_008\" , \"Location_009\" ,] ) , } With this, we went from: Initial costs: (420.042) * 2 + (462.000) * 5 + (420.000) * 3 = 4.410.084 , to Final costs: (4.200) * 2 + (420.000) * 8 = 3.368.400 Which would amount to a total save of 1.041.684\u20ac","title":"Infrastructure priority (old approach) example"},{"location":"reference/koswat_surroundings.html","text":"Surroundings \u00b6 In koswat's real domain, a dike is surrounded by all sort of surroundings, these could be nature or human-built structures. During our analyisis we make use of ( .shp ) maps where a dike's traject is shown together with all the human-built structures in its proximity. We categorize these structures in the following two types: Obstacles , surroundings that cannot be modified in any way. Infrastructures , as opposite to the obstacles, surroundings that can be repaired or removed and added again (elsewhere). Image 1. Surroundings representation To define said surroundings we make use of .csv files, each file for a specific type of surrounding that needs to be \"enabled\" in the koswat_general.ini settings file. In addition, surroundings can be defined for the inside or the outside of a dike. At the current Koswat version (unreleased v0.15.0 ) we only support surroundings in the inside of a dike ( binnendijks ). Surroundings .csv files \u00b6 The surroundings files follow all the same format both in naming and content. Their file name has the form of T{dike_traject}_{type_of_surrounding}.csv : - The {dike_traject} is the dike's traject code name, usually something like 10_1 , - the {type_of_surrounding} is the name of surrounding that will be imported (check further in the corresponding subsections of obstacles and infrastructure ). Their headers are divided in the following columns: SECTIE , section of the location in the dike's traject, Xcoord , x coordinate of the location, Ycoord , y coordinate of the location, afst_{x}m , distance from the reference point of the location, where 'x' are all the values between 5 and 200 with steps of 5, thus 40 columns. The values in these cells define whether there are obstacles or infrastructures at this distance or not and in Koswat are usually built in the SurroundingsPoint.surroundings_matrix , each type of surrounding interprets the weights in a different manner. Obstacles \u00b6 An obstacle usually represents a building. Because they cannot be removed they become a constraint to the possible reinforcements that can be applied at a given location. For instance, if a dike's reinforcement will become 5 meters wider, but within that distance there are obstacles, said reinforcement will be discarded as a possible option at that location. The distance from the reference point of the dike to the closes point of the obstacle is given. The values in the columns afst_{x}m are either 1 or 0 and are simply interpreted as having a surrounding or not. Thus ignoring other characteristics of the surrounding and just focusing on its presence. Obstacle types \u00b6 Currently we identify and support the following surroundings as written in the .csv file names: bebouwing_binnendijks (buildings), spoorwegen_binnendijks (railways), waters_binnendijks (waters), As reminder, at the moment we only support 'inside the dike's' surroundings. Infrastructures \u00b6 Infrastructures are mostly \"roads\". Contrary to the obstacles these infrastructures do not become a boundary for a reinforcement and they will simply be either displaced or repaired when applying a reinforcement requires their space. When this occurs, it is reflected as additional costs for the given type of reinforcement at that location. In short, these costs are calculated based on: The width of the infrastructure (taken from the Koswat_general.ini settings), The length of the infrastructure at that location (the values in the columns afst_{x}m ), The required technique (repair, displace, nothing) for the type of infrastructure (also from koswat_general.ini settings) and its related costs ( koswat_costs.ini ). With the above values we know what's the affected area of an infrastructure when a reinforced profile needs to be applied and therefore can estimate their costs. The distance from the reference point of the dike to the center point of the infrastructure is given. Infrastructures types \u00b6 Currently we identify and support the following surroundings as written in the .csv file names: wegen_binnendijks_klasse2 (roads class 2), wegen_binnendijks_klasse7 (roads class 7), wegen_binnendijks_klasse24 (roads class 24), wegen_binnendijks_klasse47 (roads class 47), wegen_binnendijks_klasseonbekend (roads of unknown class), As reminder, at the moment we only support 'inside the dike's' surroundings. Surroundings in the code \u00b6 But, how are these surroundings represented in the code? As earlier described, we distinguish surroundings by either obstacles or infrastructures . This is also reflected in the code where we create a general SurroundingsWrapper , which as the name states, wraps the obstacle and infrastructure surroundings in separate properties, each implementing an specialitzation of the BaseSurroundingsWrapper so that: ObstacleSurroundingsWrapper will wrap all the supported obstacle types , in separate properties of type SurroundingsObstacle . InfrastructureSurroundingsWrapper will wrap all the supported infrastructure types , in separate properties of type SurroundingsInfrastructure . A simple diagram illustrating the above can be seen in the image below: Image 2. Surroundings code-wise More detailed information can be found in the corresponding surroundings subproject .","title":"Surroundings"},{"location":"reference/koswat_surroundings.html#surroundings","text":"In koswat's real domain, a dike is surrounded by all sort of surroundings, these could be nature or human-built structures. During our analyisis we make use of ( .shp ) maps where a dike's traject is shown together with all the human-built structures in its proximity. We categorize these structures in the following two types: Obstacles , surroundings that cannot be modified in any way. Infrastructures , as opposite to the obstacles, surroundings that can be repaired or removed and added again (elsewhere). Image 1. Surroundings representation To define said surroundings we make use of .csv files, each file for a specific type of surrounding that needs to be \"enabled\" in the koswat_general.ini settings file. In addition, surroundings can be defined for the inside or the outside of a dike. At the current Koswat version (unreleased v0.15.0 ) we only support surroundings in the inside of a dike ( binnendijks ).","title":"Surroundings"},{"location":"reference/koswat_surroundings.html#surroundings-csv-files","text":"The surroundings files follow all the same format both in naming and content. Their file name has the form of T{dike_traject}_{type_of_surrounding}.csv : - The {dike_traject} is the dike's traject code name, usually something like 10_1 , - the {type_of_surrounding} is the name of surrounding that will be imported (check further in the corresponding subsections of obstacles and infrastructure ). Their headers are divided in the following columns: SECTIE , section of the location in the dike's traject, Xcoord , x coordinate of the location, Ycoord , y coordinate of the location, afst_{x}m , distance from the reference point of the location, where 'x' are all the values between 5 and 200 with steps of 5, thus 40 columns. The values in these cells define whether there are obstacles or infrastructures at this distance or not and in Koswat are usually built in the SurroundingsPoint.surroundings_matrix , each type of surrounding interprets the weights in a different manner.","title":"Surroundings .csv files"},{"location":"reference/koswat_surroundings.html#obstacles","text":"An obstacle usually represents a building. Because they cannot be removed they become a constraint to the possible reinforcements that can be applied at a given location. For instance, if a dike's reinforcement will become 5 meters wider, but within that distance there are obstacles, said reinforcement will be discarded as a possible option at that location. The distance from the reference point of the dike to the closes point of the obstacle is given. The values in the columns afst_{x}m are either 1 or 0 and are simply interpreted as having a surrounding or not. Thus ignoring other characteristics of the surrounding and just focusing on its presence.","title":"Obstacles"},{"location":"reference/koswat_surroundings.html#obstacle-types","text":"Currently we identify and support the following surroundings as written in the .csv file names: bebouwing_binnendijks (buildings), spoorwegen_binnendijks (railways), waters_binnendijks (waters), As reminder, at the moment we only support 'inside the dike's' surroundings.","title":"Obstacle types"},{"location":"reference/koswat_surroundings.html#infrastructures","text":"Infrastructures are mostly \"roads\". Contrary to the obstacles these infrastructures do not become a boundary for a reinforcement and they will simply be either displaced or repaired when applying a reinforcement requires their space. When this occurs, it is reflected as additional costs for the given type of reinforcement at that location. In short, these costs are calculated based on: The width of the infrastructure (taken from the Koswat_general.ini settings), The length of the infrastructure at that location (the values in the columns afst_{x}m ), The required technique (repair, displace, nothing) for the type of infrastructure (also from koswat_general.ini settings) and its related costs ( koswat_costs.ini ). With the above values we know what's the affected area of an infrastructure when a reinforced profile needs to be applied and therefore can estimate their costs. The distance from the reference point of the dike to the center point of the infrastructure is given.","title":"Infrastructures"},{"location":"reference/koswat_surroundings.html#infrastructures-types","text":"Currently we identify and support the following surroundings as written in the .csv file names: wegen_binnendijks_klasse2 (roads class 2), wegen_binnendijks_klasse7 (roads class 7), wegen_binnendijks_klasse24 (roads class 24), wegen_binnendijks_klasse47 (roads class 47), wegen_binnendijks_klasseonbekend (roads of unknown class), As reminder, at the moment we only support 'inside the dike's' surroundings.","title":"Infrastructures types"},{"location":"reference/koswat_surroundings.html#surroundings-in-the-code","text":"But, how are these surroundings represented in the code? As earlier described, we distinguish surroundings by either obstacles or infrastructures . This is also reflected in the code where we create a general SurroundingsWrapper , which as the name states, wraps the obstacle and infrastructure surroundings in separate properties, each implementing an specialitzation of the BaseSurroundingsWrapper so that: ObstacleSurroundingsWrapper will wrap all the supported obstacle types , in separate properties of type SurroundingsObstacle . InfrastructureSurroundingsWrapper will wrap all the supported infrastructure types , in separate properties of type SurroundingsInfrastructure . A simple diagram illustrating the above can be seen in the image below: Image 2. Surroundings code-wise More detailed information can be found in the corresponding surroundings subproject .","title":"Surroundings in the code"},{"location":"reference/koswat_docstrings/cost_report.html","text":"Cost report module \u00b6 CostReportProtocol \u00b6 Bases: Protocol A Protocol defining the properties of a report in Koswat. Infrastructure cost calculator \u00b6 ProfileZoneCalculator dataclass \u00b6 Calculator to determine the width of zones A and B of a reinforced profile ( ReinforcementProfileProtocol ). It requires its original base profile to be in its definition. calculate () -> tuple [ float , float ] \u00b6 Calculates the width of zones A and B for the defined instance of ReinforcementProfileProtocol . The calculation is as follows: - When dh0 has not varied with respect to the base profile, then zones A and B are calculated. - When dh0 has increased then only zone B is calculated. Returns: Type Description tuple [ float , float ] tuple[float, float]: Calculated zone A and B respectively. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. InfrastructureLocationCosts dataclass \u00b6 Simple data structure containing the results of the costs calculations for a given ReinforcementProfileProtocol profile. The values related to zone_a and zone_b are calculated in the ProfileZoneCalculator . InfrastructureProfileCostsCalculator dataclass \u00b6 Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b . calculate ( zone_a_width : float , zone_b_width : float ) -> list [ InfrastructureLocationCosts ] \u00b6 Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. SurroundingsInfrastructure dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is. InfrastructureProfileCostsCalculator dataclass \u00b6 Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b . calculate ( zone_a_width : float , zone_b_width : float ) -> list [ InfrastructureLocationCosts ] \u00b6 Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries. MultiInfrastructureProfileCostsCalculator dataclass \u00b6 Calculator that contains all possible \"infrastructure\" calculators ( InfrastructureProfileCostsCalculator ) one for each of the available infrastructures in the current KoswatScenario . Its calculate method only requires a reinforcement ( ReinforcementProfileProtocol ) to determine all infrastructures' costs. calculate ( reinforced_profile : ReinforcementProfileProtocol ) -> list [ InfrastructureLocationProfileCostReport ] \u00b6 Calculates the costs related to appyling the provided reinforcement_profile at all the locations where an infrastructure is present. It first determines zone A and B and then provides their widths to the inner infrastructure calculators ( InfrastructureProfileCostsCalculator ). Parameters: Name Type Description Default reinforced_profile ReinforcementProfileProtocol Reinforcement to be applied. required Returns: Type Description list [ InfrastructureLocationProfileCostReport ] list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile . ProfileZoneCalculator dataclass \u00b6 Calculator to determine the width of zones A and B of a reinforced profile ( ReinforcementProfileProtocol ). It requires its original base profile to be in its definition. calculate () -> tuple [ float , float ] \u00b6 Calculates the width of zones A and B for the defined instance of ReinforcementProfileProtocol . The calculation is as follows: - When dh0 has not varied with respect to the base profile, then zones A and B are calculated. - When dh0 has increased then only zone B is calculated. Returns: Type Description tuple [ float , float ] tuple[float, float]: Calculated zone A and B respectively. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. InfrastructureProfileCostsCalculator dataclass \u00b6 Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b . calculate ( zone_a_width : float , zone_b_width : float ) -> list [ InfrastructureLocationCosts ] \u00b6 Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries. MultiInfrastructureProfileCostsCalculator dataclass \u00b6 Calculator that contains all possible \"infrastructure\" calculators ( InfrastructureProfileCostsCalculator ) one for each of the available infrastructures in the current KoswatScenario . Its calculate method only requires a reinforcement ( ReinforcementProfileProtocol ) to determine all infrastructures' costs. calculate ( reinforced_profile : ReinforcementProfileProtocol ) -> list [ InfrastructureLocationProfileCostReport ] \u00b6 Calculates the costs related to appyling the provided reinforcement_profile at all the locations where an infrastructure is present. It first determines zone A and B and then provides their widths to the inner infrastructure calculators ( InfrastructureProfileCostsCalculator ). Parameters: Name Type Description Default reinforced_profile ReinforcementProfileProtocol Reinforcement to be applied. required Returns: Type Description list [ InfrastructureLocationProfileCostReport ] list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile . MultiInfrastructureProfileCostsCalculatorBuilder dataclass \u00b6 Bases: BuilderProtocol Builder to set up \"fix\" information such as costs derived from the koswat settings ( InfraCostsEnum , SurtaxFactorEnum ) which directly determines the zone A and/or B costs that will be applied for each infrastructure. SurroundingsInfrastructure dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is. Quantity cost parameters calculator \u00b6 CostParameterProtocol \u00b6 Bases: Protocol total_cost : float property \u00b6 The total cost (quantity * unit cost) total_cost_with_surtax : float property \u00b6 The total cost including surtaxes IO \u00b6 Summary \u00b6 KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. Summary costs \u00b6 KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. CostParameterProtocol \u00b6 Bases: Protocol total_cost : float property \u00b6 The total cost (quantity * unit cost) total_cost_with_surtax : float property \u00b6 The total cost including surtaxes KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. Summary infrastructure costs \u00b6 KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. SummaryInfrastructureCostsCsvFomBuilder dataclass \u00b6 Bases: BuilderProtocol BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. InfrastructureLocationCosts dataclass \u00b6 Simple data structure containing the results of the costs calculations for a given ReinforcementProfileProtocol profile. The values related to zone_a and zone_b are calculated in the ProfileZoneCalculator . KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. MultiLocationProfileCostReport dataclass \u00b6 Bases: CostReportProtocol get_infra_costs_per_location () -> dict [ PointSurroundings , tuple [ float , float ]] \u00b6 Gets the total costs related to infrastructures at each of the points for the profile type in profile_cost_report Returns: Type Description dict [ PointSurroundings , tuple [ float , float ]] dict[PointSurroundings, tuple[float, float]]: Total cost per location (without and with surtax). total_cost : float property \u00b6 Calculates the cost of the measure for all possible locations, regardless whether that measure is chosen by the order strategy or not. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required SummaryInfrastructureCostsCsvFomBuilder dataclass \u00b6 Bases: BuilderProtocol Summary locations \u00b6 KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required ClusterShpFom dataclass \u00b6 base_geometry : LineString property \u00b6 The resulting geometry of all locations excluding the profile's width. Returns: Name Type Description LineString LineString Geometry representing the cluster coordinates. get_buffered_geometry ( width : float ) -> LineString \u00b6 The base_geometry with an applied buffer ( width ) that represents the polderside's width. Parameters: Name Type Description Default width float Profile's polderside width. required Returns: Name Type Description LineString LineString Resulting base_geometry with a buffer. new_profile_width : float property \u00b6 The new polderside width. old_profile_width : float property \u00b6 The original polderside width. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required ClusterCollectionShpFom dataclass \u00b6 from_summary ( koswat_summary : KoswatSummary , cluster_criteria : Callable [[ StrategyLocationReinforcement ], type [ ReinforcementProfileProtocol ]] = lambda x : x . current_selected_measure ) -> ClusterCollectionShpFom classmethod \u00b6 Maps the KoswatSummary into a file object model that can be exported into *.shp files. Parameters: Name Type Description Default koswat_summary KoswatSummary The summary containing the information to export. required ]) (Lambda) Function criteria to group the locations by reinforcement type. required Returns: Name Type Description ClusterCollectionShpFom ClusterCollectionShpFom Dataclass instance that can be directly exported into .shp . generate_geodataframes () -> ClusterGeoDataFrameOutputFom \u00b6 Generates all geodataframes of the given clusters. The generated geodataframes correspond to the, base geometry (without buffering), the old and new geometries with their profile's width being buffered to the base geometry. Returns: Name Type Description ClusterGeoDataFrameOutputFom ClusterGeoDataFrameOutputFom Resulting geodataframes wrapper maping this ClusterCollectionShpFom . ClusterGeoDataFrameOutputFom \u00b6 Bases: FileObjectModelProtocol Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes . is_valid () -> bool \u00b6 Checks that all GeoDataFrame properties are set. Returns: Name Type Description bool bool Validation result. ClusterShpFom dataclass \u00b6 base_geometry : LineString property \u00b6 The resulting geometry of all locations excluding the profile's width. Returns: Name Type Description LineString LineString Geometry representing the cluster coordinates. get_buffered_geometry ( width : float ) -> LineString \u00b6 The base_geometry with an applied buffer ( width ) that represents the polderside's width. Parameters: Name Type Description Default width float Profile's polderside width. required Returns: Name Type Description LineString LineString Resulting base_geometry with a buffer. new_profile_width : float property \u00b6 The new polderside width. old_profile_width : float property \u00b6 The original polderside width. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required ClusterGeoDataFrameOutputFom \u00b6 Bases: FileObjectModelProtocol Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes . is_valid () -> bool \u00b6 Checks that all GeoDataFrame properties are set. Returns: Name Type Description bool bool Validation result. FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. ClusterCollectionShpFom dataclass \u00b6 from_summary ( koswat_summary : KoswatSummary , cluster_criteria : Callable [[ StrategyLocationReinforcement ], type [ ReinforcementProfileProtocol ]] = lambda x : x . current_selected_measure ) -> ClusterCollectionShpFom classmethod \u00b6 Maps the KoswatSummary into a file object model that can be exported into *.shp files. Parameters: Name Type Description Default koswat_summary KoswatSummary The summary containing the information to export. required ]) (Lambda) Function criteria to group the locations by reinforcement type. required Returns: Name Type Description ClusterCollectionShpFom ClusterCollectionShpFom Dataclass instance that can be directly exported into .shp . generate_geodataframes () -> ClusterGeoDataFrameOutputFom \u00b6 Generates all geodataframes of the given clusters. The generated geodataframes correspond to the, base geometry (without buffering), the old and new geometries with their profile's width being buffered to the base geometry. Returns: Name Type Description ClusterGeoDataFrameOutputFom ClusterGeoDataFrameOutputFom Resulting geodataframes wrapper maping this ClusterCollectionShpFom . KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"Cost report module"},{"location":"reference/koswat_docstrings/cost_report.html#cost-report-module","text":"","title":"Cost report module"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.cost_report_protocol.CostReportProtocol","text":"Bases: Protocol A Protocol defining the properties of a report in Koswat.","title":"CostReportProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#infrastructure-cost-calculator","text":"","title":"Infrastructure cost calculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.profile_zone_calculator.ProfileZoneCalculator","text":"Calculator to determine the width of zones A and B of a reinforced profile ( ReinforcementProfileProtocol ). It requires its original base profile to be in its definition.","title":"ProfileZoneCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.profile_zone_calculator.ProfileZoneCalculator.calculate","text":"Calculates the width of zones A and B for the defined instance of ReinforcementProfileProtocol . The calculation is as follows: - When dh0 has not varied with respect to the base profile, then zones A and B are calculated. - When dh0 has increased then only zone B is calculated. Returns: Type Description tuple [ float , float ] tuple[float, float]: Calculated zone A and B respectively.","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.profile_zone_calculator.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.InfrastructureLocationCosts","text":"Simple data structure containing the results of the costs calculations for a given ReinforcementProfileProtocol profile. The values related to zone_a and zone_b are calculated in the ProfileZoneCalculator .","title":"InfrastructureLocationCosts"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.InfrastructureProfileCostsCalculator","text":"Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b .","title":"InfrastructureProfileCostsCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.InfrastructureProfileCostsCalculator.calculate","text":"Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries.","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.SurroundingsInfrastructure","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is.","title":"SurroundingsInfrastructure"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.InfrastructureProfileCostsCalculator","text":"Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b .","title":"InfrastructureProfileCostsCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.InfrastructureProfileCostsCalculator.calculate","text":"Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries.","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.MultiInfrastructureProfileCostsCalculator","text":"Calculator that contains all possible \"infrastructure\" calculators ( InfrastructureProfileCostsCalculator ) one for each of the available infrastructures in the current KoswatScenario . Its calculate method only requires a reinforcement ( ReinforcementProfileProtocol ) to determine all infrastructures' costs.","title":"MultiInfrastructureProfileCostsCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.MultiInfrastructureProfileCostsCalculator.calculate","text":"Calculates the costs related to appyling the provided reinforcement_profile at all the locations where an infrastructure is present. It first determines zone A and B and then provides their widths to the inner infrastructure calculators ( InfrastructureProfileCostsCalculator ). Parameters: Name Type Description Default reinforced_profile ReinforcementProfileProtocol Reinforcement to be applied. required Returns: Type Description list [ InfrastructureLocationProfileCostReport ] list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile .","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.ProfileZoneCalculator","text":"Calculator to determine the width of zones A and B of a reinforced profile ( ReinforcementProfileProtocol ). It requires its original base profile to be in its definition.","title":"ProfileZoneCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.profile_zone_calculator.ProfileZoneCalculator.calculate","text":"Calculates the width of zones A and B for the defined instance of ReinforcementProfileProtocol . The calculation is as follows: - When dh0 has not varied with respect to the base profile, then zones A and B are calculated. - When dh0 has increased then only zone B is calculated. Returns: Type Description tuple [ float , float ] tuple[float, float]: Calculated zone A and B respectively.","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator_builder.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator_builder.InfrastructureProfileCostsCalculator","text":"Calculator to generate all InfrastructureLocationCosts instances based on the locations of the contained infrastructure ( SurroundingsInfrastructure.points ) and the width of zone_a and zone_b .","title":"InfrastructureProfileCostsCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.infrastructure_profile_costs_calculator.InfrastructureProfileCostsCalculator.calculate","text":"Calculates the costs affecting this instance's infrastructure at all points where it is present. Parameters: Name Type Description Default zone_a_width float Width of zone type A . required zone_b_width float Width of zone type `B . required Returns: Type Description list [ InfrastructureLocationCosts ] list[InfrastructureLocationCosts]: Resulting cost summaries.","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator_builder.MultiInfrastructureProfileCostsCalculator","text":"Calculator that contains all possible \"infrastructure\" calculators ( InfrastructureProfileCostsCalculator ) one for each of the available infrastructures in the current KoswatScenario . Its calculate method only requires a reinforcement ( ReinforcementProfileProtocol ) to determine all infrastructures' costs.","title":"MultiInfrastructureProfileCostsCalculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator.MultiInfrastructureProfileCostsCalculator.calculate","text":"Calculates the costs related to appyling the provided reinforcement_profile at all the locations where an infrastructure is present. It first determines zone A and B and then provides their widths to the inner infrastructure calculators ( InfrastructureProfileCostsCalculator ). Parameters: Name Type Description Default reinforced_profile ReinforcementProfileProtocol Reinforcement to be applied. required Returns: Type Description list [ InfrastructureLocationProfileCostReport ] list[InfrastructureLocationProfileCostReport]: Collection of reports summarizing the cost-impact of a reinforced_profile .","title":"calculate()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator_builder.MultiInfrastructureProfileCostsCalculatorBuilder","text":"Bases: BuilderProtocol Builder to set up \"fix\" information such as costs derived from the koswat settings ( InfraCostsEnum , SurtaxFactorEnum ) which directly determines the zone A and/or B costs that will be applied for each infrastructure.","title":"MultiInfrastructureProfileCostsCalculatorBuilder"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.infrastructure.multi_infrastructure_profile_costs_calculator_builder.SurroundingsInfrastructure","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is.","title":"SurroundingsInfrastructure"},{"location":"reference/koswat_docstrings/cost_report.html#quantity-cost-parameters-calculator","text":"","title":"Quantity cost parameters calculator"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.profile.quantity_cost_parameters.CostParameterProtocol","text":"Bases: Protocol","title":"CostParameterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.profile.quantity_cost_parameters.CostParameterProtocol.total_cost","text":"The total cost (quantity * unit cost)","title":"total_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.profile.quantity_cost_parameters.CostParameterProtocol.total_cost_with_surtax","text":"The total cost including surtaxes","title":"total_cost_with_surtax"},{"location":"reference/koswat_docstrings/cost_report.html#io","text":"","title":"IO"},{"location":"reference/koswat_docstrings/cost_report.html#summary","text":"","title":"Summary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.koswat_summary_exporter.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.koswat_summary_exporter.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#summary-costs","text":"","title":"Summary costs"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_exporter.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_exporter.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_fom_builder.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_fom_builder.CostParameterProtocol","text":"Bases: Protocol","title":"CostParameterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.profile.quantity_cost_parameters.CostParameterProtocol.total_cost","text":"The total cost (quantity * unit cost)","title":"total_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.profile.quantity_cost_parameters.CostParameterProtocol.total_cost_with_surtax","text":"The total cost including surtaxes","title":"total_cost_with_surtax"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_fom_builder.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_costs.summary_costs_csv_fom_builder.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#summary-infrastructure-costs","text":"","title":"Summary infrastructure costs"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_exporter.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_exporter.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_exporter.SummaryInfrastructureCostsCsvFomBuilder","text":"Bases: BuilderProtocol","title":"SummaryInfrastructureCostsCsvFomBuilder"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.InfrastructureLocationCosts","text":"Simple data structure containing the results of the costs calculations for a given ReinforcementProfileProtocol profile. The values related to zone_a and zone_b are calculated in the ProfileZoneCalculator .","title":"InfrastructureLocationCosts"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.MultiLocationProfileCostReport","text":"Bases: CostReportProtocol","title":"MultiLocationProfileCostReport"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.multi_location_profile.multi_location_profile_cost_report.MultiLocationProfileCostReport.get_infra_costs_per_location","text":"Gets the total costs related to infrastructures at each of the points for the profile type in profile_cost_report Returns: Type Description dict [ PointSurroundings , tuple [ float , float ]] dict[PointSurroundings, tuple[float, float]]: Total cost per location (without and with surtax).","title":"get_infra_costs_per_location()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.multi_location_profile.multi_location_profile_cost_report.MultiLocationProfileCostReport.total_cost","text":"Calculates the cost of the measure for all possible locations, regardless whether that measure is chosen by the order strategy or not.","title":"total_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_infrastructure_costs.summary_infrastructure_costs_csv_fom_builder.SummaryInfrastructureCostsCsvFomBuilder","text":"Bases: BuilderProtocol","title":"SummaryInfrastructureCostsCsvFomBuilder"},{"location":"reference/koswat_docstrings/cost_report.html#summary-locations","text":"","title":"Summary locations"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_exporter.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_exporter.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_fom_builder.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_fom_builder.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_fom_builder.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_fom_builder.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_csv_fom_builder.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom","text":"","title":"ClusterShpFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.base_geometry","text":"The resulting geometry of all locations excluding the profile's width. Returns: Name Type Description LineString LineString Geometry representing the cluster coordinates.","title":"base_geometry"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.get_buffered_geometry","text":"The base_geometry with an applied buffer ( width ) that represents the polderside's width. Parameters: Name Type Description Default width float Profile's polderside width. required Returns: Name Type Description LineString LineString Resulting base_geometry with a buffer.","title":"get_buffered_geometry()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.new_profile_width","text":"The new polderside width.","title":"new_profile_width"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.old_profile_width","text":"The original polderside width.","title":"old_profile_width"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterCollectionShpFom","text":"","title":"ClusterCollectionShpFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterCollectionShpFom.from_summary","text":"Maps the KoswatSummary into a file object model that can be exported into *.shp files. Parameters: Name Type Description Default koswat_summary KoswatSummary The summary containing the information to export. required ]) (Lambda) Function criteria to group the locations by reinforcement type. required Returns: Name Type Description ClusterCollectionShpFom ClusterCollectionShpFom Dataclass instance that can be directly exported into .shp .","title":"from_summary()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterCollectionShpFom.generate_geodataframes","text":"Generates all geodataframes of the given clusters. The generated geodataframes correspond to the, base geometry (without buffering), the old and new geometries with their profile's width being buffered to the base geometry. Returns: Name Type Description ClusterGeoDataFrameOutputFom ClusterGeoDataFrameOutputFom Resulting geodataframes wrapper maping this ClusterCollectionShpFom .","title":"generate_geodataframes()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterGeoDataFrameOutputFom","text":"Bases: FileObjectModelProtocol Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes .","title":"ClusterGeoDataFrameOutputFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_geodataframe_output_fom.ClusterGeoDataFrameOutputFom.is_valid","text":"Checks that all GeoDataFrame properties are set. Returns: Name Type Description bool bool Validation result.","title":"is_valid()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterShpFom","text":"","title":"ClusterShpFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.base_geometry","text":"The resulting geometry of all locations excluding the profile's width. Returns: Name Type Description LineString LineString Geometry representing the cluster coordinates.","title":"base_geometry"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.get_buffered_geometry","text":"The base_geometry with an applied buffer ( width ) that represents the polderside's width. Parameters: Name Type Description Default width float Profile's polderside width. required Returns: Name Type Description LineString LineString Resulting base_geometry with a buffer.","title":"get_buffered_geometry()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.new_profile_width","text":"The new polderside width.","title":"new_profile_width"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_shp_fom.ClusterShpFom.old_profile_width","text":"The original polderside width.","title":"old_profile_width"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_geodataframe_output_fom.ClusterGeoDataFrameOutputFom","text":"Bases: FileObjectModelProtocol Data structure to wrap the output generated by ClusterCollectionShpFom.generate_geodataframes .","title":"ClusterGeoDataFrameOutputFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_geodataframe_output_fom.ClusterGeoDataFrameOutputFom.is_valid","text":"Checks that all GeoDataFrame properties are set. Returns: Name Type Description bool bool Validation result.","title":"is_valid()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_geodataframe_output_fom.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_shp_exporter.ClusterCollectionShpFom","text":"","title":"ClusterCollectionShpFom"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterCollectionShpFom.from_summary","text":"Maps the KoswatSummary into a file object model that can be exported into *.shp files. Parameters: Name Type Description Default koswat_summary KoswatSummary The summary containing the information to export. required ]) (Lambda) Function criteria to group the locations by reinforcement type. required Returns: Name Type Description ClusterCollectionShpFom ClusterCollectionShpFom Dataclass instance that can be directly exported into .shp .","title":"from_summary()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.cluster_collection_shp_fom.ClusterCollectionShpFom.generate_geodataframes","text":"Generates all geodataframes of the given clusters. The generated geodataframes correspond to the, base geometry (without buffering), the old and new geometries with their profile's width being buffered to the base geometry. Returns: Name Type Description ClusterGeoDataFrameOutputFom ClusterGeoDataFrameOutputFom Resulting geodataframes wrapper maping this ClusterCollectionShpFom .","title":"generate_geodataframes()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_shp_exporter.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.io.summary.summary_locations.summary_locations_shp_exporter.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/cost_report.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/koswat_handler.html","text":"Koswat handler \u00b6 KoswatHandler \u00b6 Handler for CLI usage of Koswat . It allows the initialization of a logger during the analysis. __init__ ( log_output : Optional [ str ]) -> None \u00b6 Initializes the handler creating a log file at the optional provided directory log_output . Parameters: Name Type Description Default log_output Optional [ str ] Directory where to save the koswat.log file. required run_analysis ( analysis_file : str ) -> None \u00b6 Runs a Koswat analysis using the provided *.ini file analysis_file . Parameters: Name Type Description Default analysis_file str Location of the main koswat analysis ini file. required KoswatLogger \u00b6 KoswatSummary dataclass \u00b6 Represents the summary of the KOSWAT analysis. get_infrastructure_costs () -> dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] \u00b6 Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type. get_report_by_profile ( profile_type : type [ ReinforcementProfileProtocol ]) -> MultiLocationProfileCostReport | None \u00b6 Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type. KoswatSummaryBuilder dataclass \u00b6 Bases: BuilderProtocol","title":"Koswat handler"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat-handler","text":"","title":"Koswat handler"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatHandler","text":"Handler for CLI usage of Koswat . It allows the initialization of a logger during the analysis.","title":"KoswatHandler"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatHandler.__init__","text":"Initializes the handler creating a log file at the optional provided directory log_output . Parameters: Name Type Description Default log_output Optional [ str ] Directory where to save the koswat.log file. required","title":"__init__()"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatHandler.run_analysis","text":"Runs a Koswat analysis using the provided *.ini file analysis_file . Parameters: Name Type Description Default analysis_file str Location of the main koswat analysis ini file. required","title":"run_analysis()"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatLogger","text":"","title":"KoswatLogger"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatSummary","text":"Represents the summary of the KOSWAT analysis.","title":"KoswatSummary"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_infrastructure_costs","text":"Gets the infrastructure costs for each profile type for those locations for which the profile type is selected. Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], tuple [ float , float ]] dict[type[ReinforcementProfileProtocol], tuple[float, float]]: infrastructure costs without and with surtax per reinforcement type.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.cost_report.summary.koswat_summary.KoswatSummary.get_report_by_profile","text":"Get the report for a specific profile type. Parameters: Name Type Description Default profile_type type [ ReinforcementProfileProtocol ] Type of reinforcement profile. required Returns: Type Description MultiLocationProfileCostReport | None MultiLocationProfileCostReport | None: Report for the profile type.","title":"get_report_by_profile()"},{"location":"reference/koswat_docstrings/koswat_handler.html#koswat.koswat_handler.KoswatSummaryBuilder","text":"Bases: BuilderProtocol","title":"KoswatSummaryBuilder"},{"location":"reference/koswat_docstrings/koswat_main.html","text":"Main \u00b6 KoswatHandler \u00b6 Handler for CLI usage of Koswat . It allows the initialization of a logger during the analysis. __init__ ( log_output : Optional [ str ]) -> None \u00b6 Initializes the handler creating a log file at the optional provided directory log_output . Parameters: Name Type Description Default log_output Optional [ str ] Directory where to save the koswat.log file. required run_analysis ( analysis_file : str ) -> None \u00b6 Runs a Koswat analysis using the provided *.ini file analysis_file . Parameters: Name Type Description Default analysis_file str Location of the main koswat analysis ini file. required run_analysis ( input_file : str , log_output : str ) \u00b6 CLI call to execute a Koswat analysis given a settings files ( input_file ). The log is generated by default in the execute path, unless otherwise specified in the log_output argument. Parameters: Name Type Description Default input_file str Location of the *.ini file containing the execution settings for Koswat. required log_output str Optional argument to specify where will be created the koswat.log file. required","title":"Main"},{"location":"reference/koswat_docstrings/koswat_main.html#main","text":"","title":"Main"},{"location":"reference/koswat_docstrings/koswat_main.html#koswat.__main__.KoswatHandler","text":"Handler for CLI usage of Koswat . It allows the initialization of a logger during the analysis.","title":"KoswatHandler"},{"location":"reference/koswat_docstrings/koswat_main.html#koswat.koswat_handler.KoswatHandler.__init__","text":"Initializes the handler creating a log file at the optional provided directory log_output . Parameters: Name Type Description Default log_output Optional [ str ] Directory where to save the koswat.log file. required","title":"__init__()"},{"location":"reference/koswat_docstrings/koswat_main.html#koswat.koswat_handler.KoswatHandler.run_analysis","text":"Runs a Koswat analysis using the provided *.ini file analysis_file . Parameters: Name Type Description Default analysis_file str Location of the main koswat analysis ini file. required","title":"run_analysis()"},{"location":"reference/koswat_docstrings/koswat_main.html#koswat.__main__.run_analysis","text":"CLI call to execute a Koswat analysis given a settings files ( input_file ). The log is generated by default in the execute path, unless otherwise specified in the log_output argument. Parameters: Name Type Description Default input_file str Location of the *.ini file containing the execution settings for Koswat. required log_output str Optional argument to specify where will be created the koswat.log file. required","title":"run_analysis()"},{"location":"reference/koswat_docstrings/strategies.html","text":"Strategies \u00b6 StrategyInput dataclass \u00b6 Represents the input data structure for a strategy. reinforcement_min_cluster : int property \u00b6 Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length StrategyLocationInput dataclass \u00b6 available_measures : list [ type [ ReinforcementProfileProtocol ]] property \u00b6 Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list. cheapest_reinforcement : StrategyReinforcementTypeCosts property \u00b6 Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_reinforcement_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> float \u00b6 Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationInput dataclass \u00b6 available_measures : list [ type [ ReinforcementProfileProtocol ]] property \u00b6 Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list. cheapest_reinforcement : StrategyReinforcementTypeCosts property \u00b6 Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_reinforcement_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> float \u00b6 Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs. StrategyReinforcementTypeCosts dataclass \u00b6 total_costs : float property \u00b6 The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationInput dataclass \u00b6 available_measures : list [ type [ ReinforcementProfileProtocol ]] property \u00b6 Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list. cheapest_reinforcement : StrategyReinforcementTypeCosts property \u00b6 Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_reinforcement_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> float \u00b6 Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required StrategyReinforcementTypeCosts dataclass \u00b6 total_costs : float property \u00b6 The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyReinforcementTypeCosts dataclass \u00b6 total_costs : float property \u00b6 The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement. StrategyInput dataclass \u00b6 Represents the input data structure for a strategy. reinforcement_min_cluster : int property \u00b6 Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length StrategyOutput dataclass \u00b6 Represents the output data structure for a strategy. StrategyProtocol \u00b6 Bases: Protocol apply_strategy ( strategy_input : StrategyInput ) -> StrategyOutput \u00b6 Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location. Order Strategy \u00b6 OrderStrategy \u00b6 Bases: StrategyProtocol get_default_order_for_reinforcements () -> list [ type [ ReinforcementProfileProtocol ]] staticmethod \u00b6 Give the default order for reinforcements types, assuming they are sorted from cheapest to most expensive and least to most restrictive. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types get_strategy_order_for_reinforcements ( strategy_reinforcements : list [ StrategyReinforcementInput ]) -> list [ type [ ReinforcementProfileProtocol ]] \u00b6 Give the ordered reinforcement types for this strategy, from cheapest to most expensive, possibly removing reinforcement types that are more expensive and more restrictive than others. Cofferdam should always be the last reinforcement type. Input strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types get_strategy_reinforcements ( strategy_locations : list [ StrategyLocationInput ], selection_order : list [ type [ ReinforcementProfileProtocol ]]) -> list [ StrategyLocationReinforcement ] staticmethod \u00b6 Gets the strategy representation of the locations with their available measures ordered filtered and order by the provided selection_order . It also sets their initial state. Parameters: Name Type Description Default strategy_locations list [ StrategyLocationInput ] Locations to map into reinforcement locations. required selection_order list [ type [ ReinforcementProfileProtocol ]] Priority order to assign a reinforcement. required Returns: Type Description list [ StrategyLocationReinforcement ] list[StrategyLocationReinforcement]: Mapped location reinforcements. OrderStrategyBuffering dataclass \u00b6 Bases: OrderStrategyBase Applies buffering, through masks, to each location's pre-assigned reinforcement. The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_buffer requirement. OrderStrategyClustering dataclass \u00b6 Bases: OrderStrategyBase Applies clustering, to the whole collection of reinforcements ( location_reinforcements: list[StrategyLocationReinforcement] ). The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_length requirement. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyInput dataclass \u00b6 Represents the input data structure for a strategy. reinforcement_min_cluster : int property \u00b6 Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length StrategyLocationInput dataclass \u00b6 available_measures : list [ type [ ReinforcementProfileProtocol ]] property \u00b6 Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list. cheapest_reinforcement : StrategyReinforcementTypeCosts property \u00b6 Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_reinforcement_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> float \u00b6 Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required StrategyOutput dataclass \u00b6 Represents the output data structure for a strategy. StrategyProtocol \u00b6 Bases: Protocol apply_strategy ( strategy_input : StrategyInput ) -> StrategyOutput \u00b6 Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required OrderStrategyBuffering dataclass \u00b6 Bases: OrderStrategyBase Applies buffering, through masks, to each location's pre-assigned reinforcement. The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_buffer requirement. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required OrderCluster dataclass \u00b6 extend_cluster ( other : OrderCluster ) \u00b6 Extends the current cluster with the reinforcements ( list[StrategyLocationReinforcement] ) from another cluster. Modifies the current_selected_measure property of those measures being merged but it does not remove them from their source cluster. Parameters: Name Type Description Default other OrderCluster Cluster whose contents will be used to extend self . required Raises: Type Description ValueError When trying to extend from an unrelated cluster. get_stronger_cluster () -> OrderCluster \u00b6 Gets the neighbor with the lowest reinforcement type value greater than the current cluster's value ( self.reinforcement_idx ). Returns: Name Type Description OrderCluster OrderCluster Neighbor with a stronger ReinforcementProfileProtocol . is_compliant ( min_length : float , strongest_reinforcement : int ) -> bool \u00b6 Checks whether this OrderCluster instance is compliant within a cluster group. This method does not check for exceptions, such as, the cluster's neighbors are of lower strength than the current. Parameters: Name Type Description Default min_length float Minimal length a reinforcement measure is required for a cluster. required strongest_reinforcement int What is the reinforcement index which cannot be futher 'strengthen'. required Returns: Name Type Description bool bool if the cluster is compliant within its neighbors context. OrderStrategyClustering dataclass \u00b6 Bases: OrderStrategyBase Applies clustering, to the whole collection of reinforcements ( location_reinforcements: list[StrategyLocationReinforcement] ). The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_length requirement. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required OrderCluster dataclass \u00b6 extend_cluster ( other : OrderCluster ) \u00b6 Extends the current cluster with the reinforcements ( list[StrategyLocationReinforcement] ) from another cluster. Modifies the current_selected_measure property of those measures being merged but it does not remove them from their source cluster. Parameters: Name Type Description Default other OrderCluster Cluster whose contents will be used to extend self . required Raises: Type Description ValueError When trying to extend from an unrelated cluster. get_stronger_cluster () -> OrderCluster \u00b6 Gets the neighbor with the lowest reinforcement type value greater than the current cluster's value ( self.reinforcement_idx ). Returns: Name Type Description OrderCluster OrderCluster Neighbor with a stronger ReinforcementProfileProtocol . is_compliant ( min_length : float , strongest_reinforcement : int ) -> bool \u00b6 Checks whether this OrderCluster instance is compliant within a cluster group. This method does not check for exceptions, such as, the cluster's neighbors are of lower strength than the current. Parameters: Name Type Description Default min_length float Minimal length a reinforcement measure is required for a cluster. required strongest_reinforcement int What is the reinforcement index which cannot be futher 'strengthen'. required Returns: Name Type Description bool bool if the cluster is compliant within its neighbors context. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required Infra Priority Strategy \u00b6 InfraCluster dataclass \u00b6 This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ). current_cost : float property \u00b6 Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster. fits_subclusters () -> bool \u00b6 Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one. is_valid () -> bool \u00b6 Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length. set_cheapest_common_available_measure ( measure_costs : dict [ type [ ReinforcementProfileProtocol ], float ]) -> None \u00b6 Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required InfraClusterOption dataclass \u00b6 Represents one set of subclusters the strategy could select for costs optimization. add_cluster ( infra_cluster : InfraCluster , cluster_costs : dict ) \u00b6 Adds the infra cluster into the collection as well as its reinforcement costs. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster to add to this collection option. required cluster_costs dict Reinforcement costs for the given cluster. required cluster_collection : list [ InfraCluster ] property \u00b6 Read-only property to expose the stored subclusters. cluster_costs : list [ dict [ ReinforcementProfileProtocol , float ]] property \u00b6 Read-only property to expose the stored costs. set_cheapest_option () \u00b6 Sets the subclusters defined in this option to their most optimal (cheapest) reinforcement possible. valid_option () -> bool \u00b6 Validates the collection of clusters based on the required minimun length. Returns: Name Type Description bool bool Validation result. InfraPriorityStrategy \u00b6 Bases: StrategyProtocol This strategy works under the assumption that StrategyLocationReinforcement.available_measures ARE NOT ordered by \"compatibility\". Thus we need to check first which are the compatible reinforcements per cluster. generate_subcluster_options ( from_cluster : InfraCluster , min_length : int ) -> list [ list [ InfraCluster ]] staticmethod \u00b6 Generates all possible combinations of (sub) clusters based on the locations of this cluster. These are also referred as \"options\". Parameters: Name Type Description Default min_length int Minimum length for a cluster to be valid. required Returns: Type Description list [ list [ InfraCluster ]] list[list[InfraCluster]]: Collection of \"options\" with valid length. get_common_available_measures_costs ( infra_cluster : InfraCluster , order_strategy_reinforcements : list [ type [ ReinforcementProfileProtocol ]]) -> dict [ type [ ReinforcementProfileProtocol ], float ] staticmethod \u00b6 Gets a dictionary with the reinforcements available at all locations of the cluster ( infra_cluster ) as well as their total cost if said reinforcement is applied at them. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster being analyzed. required order_strategy_reinforcements list [ type [ ReinforcementProfileProtocol ]] Reinforcements ordered by base cost (ground surface). required Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], float ] dict[type[ReinforcementProfileProtocol], float]: Resulting reinforcement type - costs dictionary. OrderStrategy \u00b6 Bases: StrategyProtocol get_default_order_for_reinforcements () -> list [ type [ ReinforcementProfileProtocol ]] staticmethod \u00b6 Give the default order for reinforcements types, assuming they are sorted from cheapest to most expensive and least to most restrictive. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types get_strategy_order_for_reinforcements ( strategy_reinforcements : list [ StrategyReinforcementInput ]) -> list [ type [ ReinforcementProfileProtocol ]] \u00b6 Give the ordered reinforcement types for this strategy, from cheapest to most expensive, possibly removing reinforcement types that are more expensive and more restrictive than others. Cofferdam should always be the last reinforcement type. Input strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types get_strategy_reinforcements ( strategy_locations : list [ StrategyLocationInput ], selection_order : list [ type [ ReinforcementProfileProtocol ]]) -> list [ StrategyLocationReinforcement ] staticmethod \u00b6 Gets the strategy representation of the locations with their available measures ordered filtered and order by the provided selection_order . It also sets their initial state. Parameters: Name Type Description Default strategy_locations list [ StrategyLocationInput ] Locations to map into reinforcement locations. required selection_order list [ type [ ReinforcementProfileProtocol ]] Priority order to assign a reinforcement. required Returns: Type Description list [ StrategyLocationReinforcement ] list[StrategyLocationReinforcement]: Mapped location reinforcements. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyInput dataclass \u00b6 Represents the input data structure for a strategy. reinforcement_min_cluster : int property \u00b6 Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required StrategyOutput dataclass \u00b6 Represents the output data structure for a strategy. StrategyProtocol \u00b6 Bases: Protocol apply_strategy ( strategy_input : StrategyInput ) -> StrategyOutput \u00b6 Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location. InfraCluster dataclass \u00b6 This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ). current_cost : float property \u00b6 Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster. fits_subclusters () -> bool \u00b6 Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one. is_valid () -> bool \u00b6 Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length. set_cheapest_common_available_measure ( measure_costs : dict [ type [ ReinforcementProfileProtocol ], float ]) -> None \u00b6 Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StrategyLocationReinforcement dataclass \u00b6 Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location. current_cost : float property \u00b6 Estimates the costs at this location for the given current_selected_measure . current_selected_measure : type [ ReinforcementProfileProtocol ] property \u00b6 Exposes the current selected measure for this object. get_infrastructure_costs ( reinforcement_type : type [ ReinforcementProfileProtocol ]) -> tuple [ float , float ] \u00b6 Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax. get_selected_measure_steps () -> tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] \u00b6 Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple. set_selected_measure ( reinforcement_type : type [ ReinforcementProfileProtocol ], step : StrategyStepEnum ) \u00b6 Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required InfraCluster dataclass \u00b6 This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ). current_cost : float property \u00b6 Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster. fits_subclusters () -> bool \u00b6 Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one. is_valid () -> bool \u00b6 Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length. set_cheapest_common_available_measure ( measure_costs : dict [ type [ ReinforcementProfileProtocol ], float ]) -> None \u00b6 Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required InfraClusterOption dataclass \u00b6 Represents one set of subclusters the strategy could select for costs optimization. add_cluster ( infra_cluster : InfraCluster , cluster_costs : dict ) \u00b6 Adds the infra cluster into the collection as well as its reinforcement costs. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster to add to this collection option. required cluster_costs dict Reinforcement costs for the given cluster. required cluster_collection : list [ InfraCluster ] property \u00b6 Read-only property to expose the stored subclusters. cluster_costs : list [ dict [ ReinforcementProfileProtocol , float ]] property \u00b6 Read-only property to expose the stored costs. set_cheapest_option () \u00b6 Sets the subclusters defined in this option to their most optimal (cheapest) reinforcement possible. valid_option () -> bool \u00b6 Validates the collection of clusters based on the required minimun length. Returns: Name Type Description bool bool Validation result. ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. Strategy step \u00b6 ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"Strategies"},{"location":"reference/koswat_docstrings/strategies.html#strategies","text":"","title":"Strategies"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyInput","text":"Represents the input data structure for a strategy.","title":"StrategyInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyInput.reinforcement_min_cluster","text":"Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length","title":"reinforcement_min_cluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyLocationInput","text":"","title":"StrategyLocationInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.available_measures","text":"Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list.","title":"available_measures"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.cheapest_reinforcement","text":"Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location.","title":"cheapest_reinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_infrastructure_costs","text":"Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_reinforcement_costs","text":"Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs.","title":"get_reinforcement_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput","text":"","title":"StrategyLocationInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.available_measures","text":"Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list.","title":"available_measures"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.cheapest_reinforcement","text":"Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location.","title":"cheapest_reinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_infrastructure_costs","text":"Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_reinforcement_costs","text":"Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs.","title":"get_reinforcement_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyReinforcementTypeCosts","text":"","title":"StrategyReinforcementTypeCosts"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_type_costs.StrategyReinforcementTypeCosts.total_costs","text":"The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement.","title":"total_costs"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/strategies.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationInput","text":"","title":"StrategyLocationInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.available_measures","text":"Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list.","title":"available_measures"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.cheapest_reinforcement","text":"Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location.","title":"cheapest_reinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_infrastructure_costs","text":"Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_reinforcement_costs","text":"Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs.","title":"get_reinforcement_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyReinforcementTypeCosts","text":"","title":"StrategyReinforcementTypeCosts"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_type_costs.StrategyReinforcementTypeCosts.total_costs","text":"The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement.","title":"total_costs"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_input.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_type_costs.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_type_costs.StrategyReinforcementTypeCosts","text":"","title":"StrategyReinforcementTypeCosts"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_reinforcement_type_costs.StrategyReinforcementTypeCosts.total_costs","text":"The simple addition of the base costs and the possible related infrastructure costs. Returns: Name Type Description float float The total costs when applying this reinforcement.","title":"total_costs"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyInput","text":"Represents the input data structure for a strategy.","title":"StrategyInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyInput.reinforcement_min_cluster","text":"Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length","title":"reinforcement_min_cluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyOutput","text":"Represents the output data structure for a strategy.","title":"StrategyOutput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyProtocol","text":"Bases: Protocol","title":"StrategyProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyProtocol.apply_strategy","text":"Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location.","title":"apply_strategy()"},{"location":"reference/koswat_docstrings/strategies.html#order-strategy","text":"","title":"Order Strategy"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy","text":"Bases: StrategyProtocol","title":"OrderStrategy"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_default_order_for_reinforcements","text":"Give the default order for reinforcements types, assuming they are sorted from cheapest to most expensive and least to most restrictive. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types","title":"get_default_order_for_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_strategy_order_for_reinforcements","text":"Give the ordered reinforcement types for this strategy, from cheapest to most expensive, possibly removing reinforcement types that are more expensive and more restrictive than others. Cofferdam should always be the last reinforcement type. Input strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types","title":"get_strategy_order_for_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_strategy_reinforcements","text":"Gets the strategy representation of the locations with their available measures ordered filtered and order by the provided selection_order . It also sets their initial state. Parameters: Name Type Description Default strategy_locations list [ StrategyLocationInput ] Locations to map into reinforcement locations. required selection_order list [ type [ ReinforcementProfileProtocol ]] Priority order to assign a reinforcement. required Returns: Type Description list [ StrategyLocationReinforcement ] list[StrategyLocationReinforcement]: Mapped location reinforcements.","title":"get_strategy_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategyBuffering","text":"Bases: OrderStrategyBase Applies buffering, through masks, to each location's pre-assigned reinforcement. The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_buffer requirement.","title":"OrderStrategyBuffering"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategyClustering","text":"Bases: OrderStrategyBase Applies clustering, to the whole collection of reinforcements ( location_reinforcements: list[StrategyLocationReinforcement] ). The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_length requirement.","title":"OrderStrategyClustering"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.StrategyInput","text":"Represents the input data structure for a strategy.","title":"StrategyInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyInput.reinforcement_min_cluster","text":"Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length","title":"reinforcement_min_cluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.StrategyLocationInput","text":"","title":"StrategyLocationInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.available_measures","text":"Gets all the available reinforcement types in strategy_location_reinforcements . It is called available_measures to match the StrategyLocationReinforcement definition. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[Type[ReinforcementProfileProtocol]]: resulting list.","title":"available_measures"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.cheapest_reinforcement","text":"Gets the StrategyLocationReinforcementCosts with the lowest total_costs value. Returns: Name Type Description StrategyLocationReinforcementCosts StrategyReinforcementTypeCosts The cheapest reinforcement for this location.","title":"cheapest_reinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_infrastructure_costs","text":"Get the infrastructure costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_input.StrategyLocationInput.get_reinforcement_costs","text":"Get the costs for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] The reinforcement type. required Raises: Type Description ValueError The reinforcement type is not available. Returns: Name Type Description float float The reinforcement costs.","title":"get_reinforcement_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.StrategyOutput","text":"Represents the output data structure for a strategy.","title":"StrategyOutput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.StrategyProtocol","text":"Bases: Protocol","title":"StrategyProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyProtocol.apply_strategy","text":"Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location.","title":"apply_strategy()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_base.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_base.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_buffering.OrderStrategyBuffering","text":"Bases: OrderStrategyBase Applies buffering, through masks, to each location's pre-assigned reinforcement. The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_buffer requirement.","title":"OrderStrategyBuffering"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_buffering.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_buffering.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_clustering.OrderCluster","text":"","title":"OrderCluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.extend_cluster","text":"Extends the current cluster with the reinforcements ( list[StrategyLocationReinforcement] ) from another cluster. Modifies the current_selected_measure property of those measures being merged but it does not remove them from their source cluster. Parameters: Name Type Description Default other OrderCluster Cluster whose contents will be used to extend self . required Raises: Type Description ValueError When trying to extend from an unrelated cluster.","title":"extend_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.get_stronger_cluster","text":"Gets the neighbor with the lowest reinforcement type value greater than the current cluster's value ( self.reinforcement_idx ). Returns: Name Type Description OrderCluster OrderCluster Neighbor with a stronger ReinforcementProfileProtocol .","title":"get_stronger_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.is_compliant","text":"Checks whether this OrderCluster instance is compliant within a cluster group. This method does not check for exceptions, such as, the cluster's neighbors are of lower strength than the current. Parameters: Name Type Description Default min_length float Minimal length a reinforcement measure is required for a cluster. required strongest_reinforcement int What is the reinforcement index which cannot be futher 'strengthen'. required Returns: Name Type Description bool bool if the cluster is compliant within its neighbors context.","title":"is_compliant()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_clustering.OrderStrategyClustering","text":"Bases: OrderStrategyBase Applies clustering, to the whole collection of reinforcements ( location_reinforcements: list[StrategyLocationReinforcement] ). The result of the apply method will be the locations with the best reinforcement fit (lowest index from reinforcement_order ) that fulfills the reinforcement_min_length requirement.","title":"OrderStrategyClustering"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_clustering.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy_clustering.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster","text":"","title":"OrderCluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.extend_cluster","text":"Extends the current cluster with the reinforcements ( list[StrategyLocationReinforcement] ) from another cluster. Modifies the current_selected_measure property of those measures being merged but it does not remove them from their source cluster. Parameters: Name Type Description Default other OrderCluster Cluster whose contents will be used to extend self . required Raises: Type Description ValueError When trying to extend from an unrelated cluster.","title":"extend_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.get_stronger_cluster","text":"Gets the neighbor with the lowest reinforcement type value greater than the current cluster's value ( self.reinforcement_idx ). Returns: Name Type Description OrderCluster OrderCluster Neighbor with a stronger ReinforcementProfileProtocol .","title":"get_stronger_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.OrderCluster.is_compliant","text":"Checks whether this OrderCluster instance is compliant within a cluster group. This method does not check for exceptions, such as, the cluster's neighbors are of lower strength than the current. Parameters: Name Type Description Default min_length float Minimal length a reinforcement measure is required for a cluster. required strongest_reinforcement int What is the reinforcement index which cannot be futher 'strengthen'. required Returns: Name Type Description bool bool if the cluster is compliant within its neighbors context.","title":"is_compliant()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_cluster.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#infra-priority-strategy","text":"","title":"Infra Priority Strategy"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.InfraCluster","text":"This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ).","title":"InfraCluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.current_cost","text":"Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster.","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.fits_subclusters","text":"Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one.","title":"fits_subclusters()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.is_valid","text":"Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length.","title":"is_valid()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.set_cheapest_common_available_measure","text":"Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required","title":"set_cheapest_common_available_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.InfraClusterOption","text":"Represents one set of subclusters the strategy could select for costs optimization.","title":"InfraClusterOption"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.add_cluster","text":"Adds the infra cluster into the collection as well as its reinforcement costs. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster to add to this collection option. required cluster_costs dict Reinforcement costs for the given cluster. required","title":"add_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.cluster_collection","text":"Read-only property to expose the stored subclusters.","title":"cluster_collection"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.cluster_costs","text":"Read-only property to expose the stored costs.","title":"cluster_costs"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.set_cheapest_option","text":"Sets the subclusters defined in this option to their most optimal (cheapest) reinforcement possible.","title":"set_cheapest_option()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.valid_option","text":"Validates the collection of clusters based on the required minimun length. Returns: Name Type Description bool bool Validation result.","title":"valid_option()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.InfraPriorityStrategy","text":"Bases: StrategyProtocol This strategy works under the assumption that StrategyLocationReinforcement.available_measures ARE NOT ordered by \"compatibility\". Thus we need to check first which are the compatible reinforcements per cluster.","title":"InfraPriorityStrategy"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.InfraPriorityStrategy.generate_subcluster_options","text":"Generates all possible combinations of (sub) clusters based on the locations of this cluster. These are also referred as \"options\". Parameters: Name Type Description Default min_length int Minimum length for a cluster to be valid. required Returns: Type Description list [ list [ InfraCluster ]] list[list[InfraCluster]]: Collection of \"options\" with valid length.","title":"generate_subcluster_options()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.InfraPriorityStrategy.get_common_available_measures_costs","text":"Gets a dictionary with the reinforcements available at all locations of the cluster ( infra_cluster ) as well as their total cost if said reinforcement is applied at them. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster being analyzed. required order_strategy_reinforcements list [ type [ ReinforcementProfileProtocol ]] Reinforcements ordered by base cost (ground surface). required Returns: Type Description dict [ type [ ReinforcementProfileProtocol ], float ] dict[type[ReinforcementProfileProtocol], float]: Resulting reinforcement type - costs dictionary.","title":"get_common_available_measures_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.OrderStrategy","text":"Bases: StrategyProtocol","title":"OrderStrategy"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_default_order_for_reinforcements","text":"Give the default order for reinforcements types, assuming they are sorted from cheapest to most expensive and least to most restrictive. Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types","title":"get_default_order_for_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_strategy_order_for_reinforcements","text":"Give the ordered reinforcement types for this strategy, from cheapest to most expensive, possibly removing reinforcement types that are more expensive and more restrictive than others. Cofferdam should always be the last reinforcement type. Input strategy_reinforcements (list[StrategyReinforcementInput]): list of reinforcement types with costs and surface Returns: Type Description list [ type [ ReinforcementProfileProtocol ]] list[type[ReinforcementProfileProtocol]]: list of reinforcement types","title":"get_strategy_order_for_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.order_strategy.order_strategy.OrderStrategy.get_strategy_reinforcements","text":"Gets the strategy representation of the locations with their available measures ordered filtered and order by the provided selection_order . It also sets their initial state. Parameters: Name Type Description Default strategy_locations list [ StrategyLocationInput ] Locations to map into reinforcement locations. required selection_order list [ type [ ReinforcementProfileProtocol ]] Priority order to assign a reinforcement. required Returns: Type Description list [ StrategyLocationReinforcement ] list[StrategyLocationReinforcement]: Mapped location reinforcements.","title":"get_strategy_reinforcements()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.StrategyInput","text":"Represents the input data structure for a strategy.","title":"StrategyInput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_input.StrategyInput.reinforcement_min_cluster","text":"Returns the minimum length of a reinforcement type along a traject, usually named as cluster throughout the code. Returns: Name Type Description int int Total length","title":"reinforcement_min_cluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.StrategyOutput","text":"Represents the output data structure for a strategy.","title":"StrategyOutput"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_priority_strategy.StrategyProtocol","text":"Bases: Protocol","title":"StrategyProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_protocol.StrategyProtocol.apply_strategy","text":"Applies a specific strategy by matching each location ( PointSurroundings ) to a valid reinforcement type ( ReinforcementProfileProtocol ). Parameters: Name Type Description Default strategy_input `StrategyInput` Input data structure containing locations and available reinforcements for each of them. required Returns: Name Type Description StrategyOutput StrategyOutput Output data structure containing the selected reinforcements for each location.","title":"apply_strategy()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster","text":"This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ).","title":"InfraCluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.current_cost","text":"Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster.","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.fits_subclusters","text":"Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one.","title":"fits_subclusters()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.is_valid","text":"Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length.","title":"is_valid()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.set_cheapest_common_available_measure","text":"Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required","title":"set_cheapest_common_available_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.StrategyLocationReinforcement","text":"Represents a location and the different reinforcements that can be applied to it as well their costs. This class is used to show the final chosen state for a location.","title":"StrategyLocationReinforcement"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_cost","text":"Estimates the costs at this location for the given current_selected_measure .","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.current_selected_measure","text":"Exposes the current selected measure for this object.","title":"current_selected_measure"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_infrastructure_costs","text":"Returns the infrastructure costs for the given reinforcement type (without and with surtax). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type. required Returns: Type Description tuple [ float , float ] tuple[float, float]: Tuple containing the infrastructure costs without and with surtax.","title":"get_infrastructure_costs()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.get_selected_measure_steps","text":"Outputs the selected measure following the domain (expected) steps: - Initial step, - Order step, - Infrastructure step Returns: Type Description tuple [ type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ], type [ ReinforcementProfileProtocol ]] tuple[ type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol], type[ReinforcementProfileProtocol]]: Resulting tuple.","title":"get_selected_measure_steps()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_location_reinforcement.StrategyLocationReinforcement.set_selected_measure","text":"Changes the value reprsented in current_selected_measure and updates the dictionary of selections (history). Parameters: Name Type Description Default reinforcement_type type [ ReinforcementProfileProtocol ] Reinforcement type required step StrategyStepsEnum Step whose required","title":"set_selected_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraCluster","text":"This dataclass represents the subset of locations sharing the same reinforcement type ( type[ReinforcementProfileProtocol] ).","title":"InfraCluster"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.current_cost","text":"Calculates the cost of applying the reinforcement_type to all locations present in the cluster . Returns: Name Type Description float float The total (current) cost of this cluster.","title":"current_cost"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.fits_subclusters","text":"Validates whether this cluster can be split into subclusters. For that it requires to have at least twice the required length. Returns: Name Type Description bool bool Whether subclusters can be generated from this one.","title":"fits_subclusters()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.is_valid","text":"Validates the length of this cluster. Returns: Name Type Description bool bool The cluster has the minimal required length.","title":"is_valid()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster.InfraCluster.set_cheapest_common_available_measure","text":"Updates all the location reinforcements with the cheapest reinforcement type from the measure_costs . Parameters: Name Type Description Default measure_costs dict [ type [ ReinforcementProfileProtocol ]] dictionary with the total costs per reinforcement type. required","title":"set_cheapest_common_available_measure()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption","text":"Represents one set of subclusters the strategy could select for costs optimization.","title":"InfraClusterOption"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.add_cluster","text":"Adds the infra cluster into the collection as well as its reinforcement costs. Parameters: Name Type Description Default infra_cluster InfraCluster Cluster to add to this collection option. required cluster_costs dict Reinforcement costs for the given cluster. required","title":"add_cluster()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.cluster_collection","text":"Read-only property to expose the stored subclusters.","title":"cluster_collection"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.cluster_costs","text":"Read-only property to expose the stored costs.","title":"cluster_costs"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.set_cheapest_option","text":"Sets the subclusters defined in this option to their most optimal (cheapest) reinforcement possible.","title":"set_cheapest_option()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.InfraClusterOption.valid_option","text":"Validates the collection of clusters based on the required minimun length. Returns: Name Type Description bool bool Validation result.","title":"valid_option()"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.infra_priority_strategy.infra_cluster_option.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/strategies.html#strategy-step","text":"","title":"Strategy step"},{"location":"reference/koswat_docstrings/strategies.html#koswat.strategies.strategy_step.strategy_step_assignment.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/configuration/koswat_config_protocol.html","text":"Koswat Config Protocol \u00b6 DataObjectModelProtocol \u00b6 Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance. KoswatConfigProtocol \u00b6 Bases: DataObjectModelProtocol , Protocol is_valid () -> bool \u00b6 Validates the current KoswatConfigProtocol instance. Returns: Name Type Description bool bool True when the current instance is valid to be used as a configuration class.","title":"Koswat Config Protocol"},{"location":"reference/koswat_docstrings/configuration/koswat_config_protocol.html#koswat-config-protocol","text":"","title":"Koswat Config Protocol"},{"location":"reference/koswat_docstrings/configuration/koswat_config_protocol.html#koswat.configuration.koswat_config_protocol.DataObjectModelProtocol","text":"Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.","title":"DataObjectModelProtocol"},{"location":"reference/koswat_docstrings/configuration/koswat_config_protocol.html#koswat.configuration.koswat_config_protocol.KoswatConfigProtocol","text":"Bases: DataObjectModelProtocol , Protocol","title":"KoswatConfigProtocol"},{"location":"reference/koswat_docstrings/configuration/koswat_config_protocol.html#koswat.configuration.koswat_config_protocol.KoswatConfigProtocol.is_valid","text":"Validates the current KoswatConfigProtocol instance. Returns: Name Type Description bool bool True when the current instance is valid to be used as a configuration class.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/geometries.html","text":"Core geometries module \u00b6 as_unified_geometry ( source_geom : geometry . Polygon | geometry . MultiPolygon ) -> geometry . Polygon \u00b6 Ensures the calculated geometry is returned as a single polygon. Parameters: Name Type Description Default source_geom geometry . Polygon | geometry . MultiPolygon Calculated source geometry. required Returns: Type Description geometry . Polygon geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate). get_groundlevel_surface ( pol_geometry : geometry . Polygon ) -> geometry . LineString \u00b6 Returns all the points which are at 'groundlevel' values (y = 0) Parameters: Name Type Description Default pol_geometry geometry . Polygon Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Line with points at y = 0. get_normalized_polygon_difference ( left_geom : geometry . Polygon , right_geom : geometry . Polygon ) -> geometry . Polygon | geometry . MultiPolygon \u00b6 Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors. Parameters: Name Type Description Default left_geom geometry . Polygon Base polygon from where to substract. required right_geom geometry . Polygon Polygon to substract from base. required Returns: Type Description geometry . Polygon | geometry . MultiPolygon geometry.Polygon: Resulting normalized substraction polygon. get_polygon_coordinates ( pol_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry. get_polygon_surface_points ( base_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry. get_relative_core_layer ( core_geometry : geometry . Polygon , coating_geometry : geometry . Polygon ) -> geometry . Polygon \u00b6 Returns a new 'core' from the original core_geometry relative to the coating_geometry . Parameters: Name Type Description Default core_geometry Polygon Original core geometry on which layers are stacked upon. required coating_geometry Polygon Layer wrapping the exterior of a core geometry. required Returns: Name Type Description Polygon geometry . Polygon Layer wrapping a reduced surface of the core_geometry . order_geometry_points ( dike_polygon : geometry . Polygon ) -> geometry . Polygon \u00b6 In koswat we handle polygon operations expecting the lowest 'x' coordinate to be the initial and last point of a geometry. For this reason we need to ensure all geometries are 'normalized' based on this criteria. Parameters: Name Type Description Default dike_polygon geometry . Polygon Polygon to normalized. required Returns: Type Description geometry . Polygon geometry.Polygon: Normalized polygon. profile_points_to_polygon ( points_list : list [ geometry . Point ]) -> geometry . Polygon \u00b6 Transforms a list of points into a valid 'dike' polygon. When there is a difference in height between left and right side then we correct it in the x = 0 coordinate. Parameters: Name Type Description Default points_list List [ geometry . Point ] List of points representing a dike profile. required Returns: Type Description geometry . Polygon geometry.Polygon: Validated enclosed geometry simple polygon. remove_layer_from_polygon ( dike_polygon : geometry . Polygon , layer_depth : float ) -> geometry . Polygon \u00b6 Gets the dike profile without a layer of provided layer_depth depth. Parameters: Name Type Description Default dike_polygon geometry . Polygon Source geometry. required layer_depth float Depth of a layer from the outer dike_polygon geometry inwards. required Returns: Type Description geometry . Polygon geometry.Polygon: Resulting geometry when removing the layer.","title":"Core geometries module"},{"location":"reference/koswat_docstrings/core/geometries.html#core-geometries-module","text":"","title":"Core geometries module"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.as_unified_geometry","text":"Ensures the calculated geometry is returned as a single polygon. Parameters: Name Type Description Default source_geom geometry . Polygon | geometry . MultiPolygon Calculated source geometry. required Returns: Type Description geometry . Polygon geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate).","title":"as_unified_geometry()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.get_groundlevel_surface","text":"Returns all the points which are at 'groundlevel' values (y = 0) Parameters: Name Type Description Default pol_geometry geometry . Polygon Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Line with points at y = 0.","title":"get_groundlevel_surface()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.get_normalized_polygon_difference","text":"Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors. Parameters: Name Type Description Default left_geom geometry . Polygon Base polygon from where to substract. required right_geom geometry . Polygon Polygon to substract from base. required Returns: Type Description geometry . Polygon | geometry . MultiPolygon geometry.Polygon: Resulting normalized substraction polygon.","title":"get_normalized_polygon_difference()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.get_polygon_coordinates","text":"Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry.","title":"get_polygon_coordinates()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.get_polygon_surface_points","text":"Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry.","title":"get_polygon_surface_points()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.get_relative_core_layer","text":"Returns a new 'core' from the original core_geometry relative to the coating_geometry . Parameters: Name Type Description Default core_geometry Polygon Original core geometry on which layers are stacked upon. required coating_geometry Polygon Layer wrapping the exterior of a core geometry. required Returns: Name Type Description Polygon geometry . Polygon Layer wrapping a reduced surface of the core_geometry .","title":"get_relative_core_layer()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.order_geometry_points","text":"In koswat we handle polygon operations expecting the lowest 'x' coordinate to be the initial and last point of a geometry. For this reason we need to ensure all geometries are 'normalized' based on this criteria. Parameters: Name Type Description Default dike_polygon geometry . Polygon Polygon to normalized. required Returns: Type Description geometry . Polygon geometry.Polygon: Normalized polygon.","title":"order_geometry_points()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.profile_points_to_polygon","text":"Transforms a list of points into a valid 'dike' polygon. When there is a difference in height between left and right side then we correct it in the x = 0 coordinate. Parameters: Name Type Description Default points_list List [ geometry . Point ] List of points representing a dike profile. required Returns: Type Description geometry . Polygon geometry.Polygon: Validated enclosed geometry simple polygon.","title":"profile_points_to_polygon()"},{"location":"reference/koswat_docstrings/core/geometries.html#koswat.core.geometries.calc_library.remove_layer_from_polygon","text":"Gets the dike profile without a layer of provided layer_depth depth. Parameters: Name Type Description Default dike_polygon geometry . Polygon Source geometry. required layer_depth float Depth of a layer from the outer dike_polygon geometry inwards. required Returns: Type Description geometry . Polygon geometry.Polygon: Resulting geometry when removing the layer.","title":"remove_layer_from_polygon()"},{"location":"reference/koswat_docstrings/core/io.html","text":"Input Output core module \u00b6 FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. DataObjectModelProtocol \u00b6 Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance. KoswatImporterProtocol \u00b6 Bases: Protocol import_from ( from_path : Path ) -> Union [ DataObjectModelProtocol , List [ DataObjectModelProtocol ]] \u00b6 Generates a valid instance of a DataObjectModelProtocol based on the contents from the provided path. Parameters: Name Type Description Default from_path Path Path containing data to be read. required Returns: Type Description Union [ DataObjectModelProtocol , List [ DataObjectModelProtocol ]] Union[DataObjectModelProtocol, List[DataObjectModelProtocol]]: Either a single valid instance of a DataObjectModelProtocol or a list of them. FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatReaderProtocol \u00b6 Bases: Protocol read ( file_path : Path ) -> FileObjectModelProtocol \u00b6 Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file. supports_file ( file_path : Path ) -> bool \u00b6 Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation. FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatWriterProtocol \u00b6 Bases: Protocol write ( fom_instance : FileObjectModelProtocol , to_path : Path ) -> None \u00b6 Writes the data from the instance of a FileObjectModelProtocol to the to_path . Parameters: Name Type Description Default fom_instance FileObjectModelProtocol Instance with data to write. required to_path Path Path to file (or directory) where to write the data. required CSV module \u00b6 FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatCsvFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol is_valid () -> bool \u00b6 Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM. KoswatCsvFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol is_valid () -> bool \u00b6 Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM. KoswatReaderProtocol \u00b6 Bases: Protocol read ( file_path : Path ) -> FileObjectModelProtocol \u00b6 Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file. supports_file ( file_path : Path ) -> bool \u00b6 Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation. KoswatCsvFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol is_valid () -> bool \u00b6 Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM. KoswatWriterProtocol \u00b6 Bases: Protocol write ( fom_instance : FileObjectModelProtocol , to_path : Path ) -> None \u00b6 Writes the data from the instance of a FileObjectModelProtocol to the to_path . Parameters: Name Type Description Default fom_instance FileObjectModelProtocol Instance with data to write. required to_path Path Path to file (or directory) where to write the data. required INI module \u00b6 FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatIniFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol from_config ( ini_config : ConfigParser ) -> KoswatIniFomProtocol classmethod \u00b6 Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance. Parameters: Name Type Description Default ini_config ConfigParser Dictionary containing Ini values (section - properties, property - value) to be parsed. required Returns: Name Type Description KoswatIniFomProtocol KoswatIniFomProtocol Valid instance of a KoswatIniFomProtocol with the provided values. KoswatIniFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol from_config ( ini_config : ConfigParser ) -> KoswatIniFomProtocol classmethod \u00b6 Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance. Parameters: Name Type Description Default ini_config ConfigParser Dictionary containing Ini values (section - properties, property - value) to be parsed. required Returns: Name Type Description KoswatIniFomProtocol KoswatIniFomProtocol Valid instance of a KoswatIniFomProtocol with the provided values. KoswatReaderProtocol \u00b6 Bases: Protocol read ( file_path : Path ) -> FileObjectModelProtocol \u00b6 Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file. supports_file ( file_path : Path ) -> bool \u00b6 Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation. TXT module \u00b6 FileObjectModelProtocol \u00b6 Bases: Protocol is_valid () -> bool \u00b6 Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation. KoswatTxtFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol from_text ( file_text : str ) -> KoswatTxtFomProtocol classmethod \u00b6 Imports all the data stored in text form. Parameters: Name Type Description Default file_text str Raw data in string format. required Returns: Name Type Description KoswatTxtFomProtocol KoswatTxtFomProtocol Valid instance of a KoswatTxtFomProtocol with the provided values. KoswatReaderProtocol \u00b6 Bases: Protocol read ( file_path : Path ) -> FileObjectModelProtocol \u00b6 Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file. supports_file ( file_path : Path ) -> bool \u00b6 Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation. KoswatTxtFomProtocol \u00b6 Bases: FileObjectModelProtocol , Protocol from_text ( file_text : str ) -> KoswatTxtFomProtocol classmethod \u00b6 Imports all the data stored in text form. Parameters: Name Type Description Default file_text str Raw data in string format. required Returns: Name Type Description KoswatTxtFomProtocol KoswatTxtFomProtocol Valid instance of a KoswatTxtFomProtocol with the provided values.","title":"Input Output core module"},{"location":"reference/koswat_docstrings/core/io.html#input-output-core-module","text":"","title":"Input Output core module"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_importer_protocol.DataObjectModelProtocol","text":"Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.","title":"DataObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_importer_protocol.KoswatImporterProtocol","text":"Bases: Protocol","title":"KoswatImporterProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_importer_protocol.KoswatImporterProtocol.import_from","text":"Generates a valid instance of a DataObjectModelProtocol based on the contents from the provided path. Parameters: Name Type Description Default from_path Path Path containing data to be read. required Returns: Type Description Union [ DataObjectModelProtocol , List [ DataObjectModelProtocol ]] Union[DataObjectModelProtocol, List[DataObjectModelProtocol]]: Either a single valid instance of a DataObjectModelProtocol or a list of them.","title":"import_from()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol","text":"Bases: Protocol","title":"KoswatReaderProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.read","text":"Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file.","title":"read()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.supports_file","text":"Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation.","title":"supports_file()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_writer_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_writer_protocol.KoswatWriterProtocol","text":"Bases: Protocol","title":"KoswatWriterProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_writer_protocol.KoswatWriterProtocol.write","text":"Writes the data from the instance of a FileObjectModelProtocol to the to_path . Parameters: Name Type Description Default fom_instance FileObjectModelProtocol Instance with data to write. required to_path Path Path to file (or directory) where to write the data. required","title":"write()"},{"location":"reference/koswat_docstrings/core/io.html#csv-module","text":"","title":"CSV module"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom_protocol.KoswatCsvFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatCsvFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom_protocol.KoswatCsvFomProtocol.is_valid","text":"Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom.KoswatCsvFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatCsvFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom_protocol.KoswatCsvFomProtocol.is_valid","text":"Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_reader.KoswatReaderProtocol","text":"Bases: Protocol","title":"KoswatReaderProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.read","text":"Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file.","title":"read()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.supports_file","text":"Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation.","title":"supports_file()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_writer.KoswatCsvFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatCsvFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_fom_protocol.KoswatCsvFomProtocol.is_valid","text":"Validates the current structure of this KoswatCsvFomProtocol instance. Returns: Name Type Description bool bool True when is a valid FOM.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.csv.koswat_csv_writer.KoswatWriterProtocol","text":"Bases: Protocol","title":"KoswatWriterProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_writer_protocol.KoswatWriterProtocol.write","text":"Writes the data from the instance of a FileObjectModelProtocol to the to_path . Parameters: Name Type Description Default fom_instance FileObjectModelProtocol Instance with data to write. required to_path Path Path to file (or directory) where to write the data. required","title":"write()"},{"location":"reference/koswat_docstrings/core/io.html#ini-module","text":"","title":"INI module"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_fom_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_fom_protocol.KoswatIniFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatIniFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_fom_protocol.KoswatIniFomProtocol.from_config","text":"Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance. Parameters: Name Type Description Default ini_config ConfigParser Dictionary containing Ini values (section - properties, property - value) to be parsed. required Returns: Name Type Description KoswatIniFomProtocol KoswatIniFomProtocol Valid instance of a KoswatIniFomProtocol with the provided values.","title":"from_config()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_reader.KoswatIniFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatIniFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_fom_protocol.KoswatIniFomProtocol.from_config","text":"Imports all the data stored in an dictionary into a KoswatIniFomProtocol instance. Parameters: Name Type Description Default ini_config ConfigParser Dictionary containing Ini values (section - properties, property - value) to be parsed. required Returns: Name Type Description KoswatIniFomProtocol KoswatIniFomProtocol Valid instance of a KoswatIniFomProtocol with the provided values.","title":"from_config()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.ini.koswat_ini_reader.KoswatReaderProtocol","text":"Bases: Protocol","title":"KoswatReaderProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.read","text":"Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file.","title":"read()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.supports_file","text":"Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation.","title":"supports_file()"},{"location":"reference/koswat_docstrings/core/io.html#txt-module","text":"","title":"TXT module"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_fom_protocol.FileObjectModelProtocol","text":"Bases: Protocol","title":"FileObjectModelProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.file_object_model_protocol.FileObjectModelProtocol.is_valid","text":"Verifies if the current object is valid for import / export. Returns: Name Type Description bool bool Result of the validation.","title":"is_valid()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_fom_protocol.KoswatTxtFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatTxtFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_fom_protocol.KoswatTxtFomProtocol.from_text","text":"Imports all the data stored in text form. Parameters: Name Type Description Default file_text str Raw data in string format. required Returns: Name Type Description KoswatTxtFomProtocol KoswatTxtFomProtocol Valid instance of a KoswatTxtFomProtocol with the provided values.","title":"from_text()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_reader.KoswatReaderProtocol","text":"Bases: Protocol","title":"KoswatReaderProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.read","text":"Imports the data from the file_path into a concrete implementation of a FileObjectModelProtocol . Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description FileObjectModelProtocol FileObjectModelProtocol Model representing the data in the file.","title":"read()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.koswat_reader_protocol.KoswatReaderProtocol.supports_file","text":"Validates whether the current reader is capable of importing data from the provided file. Parameters: Name Type Description Default file_path Path Path to a file that should be imported. required Returns: Name Type Description bool bool Result of validation.","title":"supports_file()"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_reader.KoswatTxtFomProtocol","text":"Bases: FileObjectModelProtocol , Protocol","title":"KoswatTxtFomProtocol"},{"location":"reference/koswat_docstrings/core/io.html#koswat.core.io.txt.koswat_txt_fom_protocol.KoswatTxtFomProtocol.from_text","text":"Imports all the data stored in text form. Parameters: Name Type Description Default file_text str Raw data in string format. required Returns: Name Type Description KoswatTxtFomProtocol KoswatTxtFomProtocol Valid instance of a KoswatTxtFomProtocol with the provided values.","title":"from_text()"},{"location":"reference/koswat_docstrings/core/koswat_logger.html","text":"Koswat logger \u00b6 KoswatLogger \u00b6","title":"Koswat logger"},{"location":"reference/koswat_docstrings/core/koswat_logger.html#koswat-logger","text":"","title":"Koswat logger"},{"location":"reference/koswat_docstrings/core/koswat_logger.html#koswat.core.koswat_logger.KoswatLogger","text":"","title":"KoswatLogger"},{"location":"reference/koswat_docstrings/core/protocols.html","text":"Core protocols module \u00b6 BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. DataObjectModelProtocol \u00b6 Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.","title":"Core protocols module"},{"location":"reference/koswat_docstrings/core/protocols.html#core-protocols-module","text":"","title":"Core protocols module"},{"location":"reference/koswat_docstrings/core/protocols.html#koswat.core.protocols.builder_protocol.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/core/protocols.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/core/protocols.html#koswat.core.protocols.data_object_model_protocol.DataObjectModelProtocol","text":"Bases: Protocol Empty protocol just to be able to classify other classes as a DataObjectModelProtocol Instance.","title":"DataObjectModelProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html","text":"Dike layers module. \u00b6 BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. KoswatLayerBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> KoswatLayerProtocol \u00b6 Builds an instance of a KoswatLayerProtocol based on the provided upper_linestring and layer_data Returns: Name Type Description KoswatLayerProtocol KoswatLayerProtocol Valid instance of a KoswatLayerProtocol . KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. Layers wrapper \u00b6 BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. KoswatLayersWrapperBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> KoswatLayersWrapperProtocol \u00b6 Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol . KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ). KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"Dike layers module."},{"location":"reference/koswat_docstrings/dike/layers.html#dike-layers-module","text":"","title":"Dike layers module."},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_builder_protocol.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_builder_protocol.KoswatLayerBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"KoswatLayerBuilderProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_builder_protocol.KoswatLayerBuilderProtocol.build","text":"Builds an instance of a KoswatLayerProtocol based on the provided upper_linestring and layer_data Returns: Name Type Description KoswatLayerProtocol KoswatLayerProtocol Valid instance of a KoswatLayerProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_builder_protocol.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike/layers.html#layers-wrapper","text":"","title":"Layers wrapper"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.KoswatLayersWrapperBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"KoswatLayersWrapperBuilderProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.KoswatLayersWrapperBuilderProtocol.build","text":"Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/dike/layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike/profile.html","text":"Koswat dike profile module \u00b6 KoswatLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : List [ KoswatLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description List [ KoswatLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"Koswat dike profile module"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat-dike-profile-module","text":"","title":"Koswat dike profile module"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.profile.koswat_profile.KoswatLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"KoswatLayersWrapper"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper.KoswatLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description List [ KoswatLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike/profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike/surroundings.html","text":"Koswat dike surroundings \u00b6 KoswatSurroundingsProtocol \u00b6 Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. KoswatSurroundingsProtocol \u00b6 Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. SurroundingsInfrastructure dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is. KoswatSurroundingsProtocol \u00b6 Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. SurroundingsObstacle dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that cannot be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a 1 (obstacle present) or a 0 (obstacle not present). Point \u00b6 PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. PointSurroundingsListPoldersideBuilder dataclass \u00b6 Bases: BuilderProtocol Builds a collection of points ( list[PointSurroundings] ) given the dike locations ( KoswatDikeLocationsShpFom ) and the surroundings around it ( KoswatSurroundingsCsvFom ). Wrapper \u00b6 ObstacleSurroundingsWrapper dataclass \u00b6 Bases: BaseSurroundingsWrapper get_locations_at_safe_distance ( distance : float ) -> list [ PointSurroundings ] \u00b6 Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of safe locations (points with surroundings). obstacle_locations : list [ PointSurroundings ] property \u00b6 Overlay of locations of the different ObstacleSurroundings that are present. Buildings need to be present as input (leading for location coordinates). Each location represents 1 meter in a real scale map. Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of locations with only the closest distance to obstacle(s). PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. SurroundingsWrapper dataclass \u00b6 get_locations_at_safe_distance ( distance : float ) -> list [ PointSurroundings ] \u00b6 Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] List[PointSurroundings]: List of safe locations (points with surroundings). BaseSurroundingsWrapper \u00b6 Bases: ABC surroundings_collection : dict [ str , KoswatSurroundingsProtocol ] property \u00b6 The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis. Returns: Type Description dict [ str , KoswatSurroundingsProtocol ] dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis. SurroundingsInfrastructure dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is. BaseSurroundingsWrapper \u00b6 Bases: ABC surroundings_collection : dict [ str , KoswatSurroundingsProtocol ] property \u00b6 The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis. Returns: Type Description dict [ str , KoswatSurroundingsProtocol ] dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis. ObstacleSurroundingsWrapper dataclass \u00b6 Bases: BaseSurroundingsWrapper get_locations_at_safe_distance ( distance : float ) -> list [ PointSurroundings ] \u00b6 Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of safe locations (points with surroundings). obstacle_locations : list [ PointSurroundings ] property \u00b6 Overlay of locations of the different ObstacleSurroundings that are present. Buildings need to be present as input (leading for location coordinates). Each location represents 1 meter in a real scale map. Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of locations with only the closest distance to obstacle(s). PointSurroundings dataclass \u00b6 Object representing a meter with x , y coordinates in a polder (or else). __eq__ ( __value : object ) -> bool \u00b6 Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict. __hash__ () -> int \u00b6 Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict. closest_obstacle : float property \u00b6 Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding. get_total_infrastructure_per_zone ( * zone_limit_collection : tuple [ float , float ]) -> list [ float ] \u00b6 Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone. SurroundingsObstacle dataclass \u00b6 Bases: KoswatSurroundingsProtocol Defines surroundings point collections that cannot be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a 1 (obstacle present) or a 0 (obstacle not present).","title":"Koswat dike surroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat-dike-surroundings","text":"","title":"Koswat dike surroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.koswat_surroundings_protocol.KoswatSurroundingsProtocol","text":"Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.","title":"KoswatSurroundingsProtocol"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.koswat_surroundings_protocol.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_infrastructure.KoswatSurroundingsProtocol","text":"Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.","title":"KoswatSurroundingsProtocol"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_infrastructure.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_infrastructure.SurroundingsInfrastructure","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is.","title":"SurroundingsInfrastructure"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_obstacle.KoswatSurroundingsProtocol","text":"Bases: Protocol Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.","title":"KoswatSurroundingsProtocol"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_obstacle.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.surroundings_obstacle.SurroundingsObstacle","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that cannot be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a 1 (obstacle present) or a 0 (obstacle not present).","title":"SurroundingsObstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#point","text":"","title":"Point"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings_list_polderside_builder.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings_list_polderside_builder.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings_list_polderside_builder.PointSurroundingsListPoldersideBuilder","text":"Bases: BuilderProtocol Builds a collection of points ( list[PointSurroundings] ) given the dike locations ( KoswatDikeLocationsShpFom ) and the surroundings around it ( KoswatSurroundingsCsvFom ).","title":"PointSurroundingsListPoldersideBuilder"},{"location":"reference/koswat_docstrings/dike/surroundings.html#wrapper","text":"","title":"Wrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.surroundings_wrapper.ObstacleSurroundingsWrapper","text":"Bases: BaseSurroundingsWrapper","title":"ObstacleSurroundingsWrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.ObstacleSurroundingsWrapper.get_locations_at_safe_distance","text":"Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of safe locations (points with surroundings).","title":"get_locations_at_safe_distance()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.ObstacleSurroundingsWrapper.obstacle_locations","text":"Overlay of locations of the different ObstacleSurroundings that are present. Buildings need to be present as input (leading for location coordinates). Each location represents 1 meter in a real scale map. Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of locations with only the closest distance to obstacle(s).","title":"obstacle_locations"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.surroundings_wrapper.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.surroundings_wrapper.SurroundingsWrapper","text":"","title":"SurroundingsWrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.surroundings_wrapper.SurroundingsWrapper.get_locations_at_safe_distance","text":"Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] List[PointSurroundings]: List of safe locations (points with surroundings).","title":"get_locations_at_safe_distance()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.infrastructure_surroundings_wrapper.BaseSurroundingsWrapper","text":"Bases: ABC","title":"BaseSurroundingsWrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.base_surroundings_wrapper.BaseSurroundingsWrapper.surroundings_collection","text":"The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis. Returns: Type Description dict [ str , KoswatSurroundingsProtocol ] dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis.","title":"surroundings_collection"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.infrastructure_surroundings_wrapper.SurroundingsInfrastructure","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that can be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is.","title":"SurroundingsInfrastructure"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.BaseSurroundingsWrapper","text":"Bases: ABC","title":"BaseSurroundingsWrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.base_surroundings_wrapper.BaseSurroundingsWrapper.surroundings_collection","text":"The collection of KoswatSurroundingsProtocol objects that are considered for a scenario analysis. Returns: Type Description dict [ str , KoswatSurroundingsProtocol ] dict[str, KoswatSurroundingsProtocol]: Collection of surroundings to include in analysis.","title":"surroundings_collection"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.ObstacleSurroundingsWrapper","text":"Bases: BaseSurroundingsWrapper","title":"ObstacleSurroundingsWrapper"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.ObstacleSurroundingsWrapper.get_locations_at_safe_distance","text":"Gets all locations which are safe from obstacle surroundings in a radius of distance . Parameters: Name Type Description Default distance float Radius from each point that should be free of surroundings. required Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of safe locations (points with surroundings).","title":"get_locations_at_safe_distance()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.ObstacleSurroundingsWrapper.obstacle_locations","text":"Overlay of locations of the different ObstacleSurroundings that are present. Buildings need to be present as input (leading for location coordinates). Each location represents 1 meter in a real scale map. Returns: Type Description list [ PointSurroundings ] list[PointSurroundings]: List of locations with only the closest distance to obstacle(s).","title":"obstacle_locations"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.PointSurroundings","text":"Object representing a meter with x , y coordinates in a polder (or else).","title":"PointSurroundings"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__eq__","text":"Overriding of the \"magic\" equality operator required so that PointSurroundings can be used as a key in a python dict.","title":"__eq__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.__hash__","text":"Overriding of the \"magic\" hash operator required so that PointSurroundings can be used as a key in a python dict.","title":"__hash__()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.closest_obstacle","text":"Distance to the closest (obstacle) surrounding. When no surroundings are given the value will be NaN (Not A Number), so that the value 0 is reserved for buildings at distance 0. Returns: Name Type Description float float Distance to the closest surrounding.","title":"closest_obstacle"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.point.point_surroundings.PointSurroundings.get_total_infrastructure_per_zone","text":"Gets the total infrastructure width at each of the provided zones zone_limit_collection ( tuple[float, float] ). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will \"claim\" the corresponding surrounding distance. Example zone_limit_collection = (0, 4), (4, 11) surroundings_matrix = {5: 1.5, 10: 3, 15: 6} \"Taken\" distances per zone: (0, 4) takes key 5 . (4, 11) takes key(s) 10 and 15 because 5 was already taken. Total infrastructure width at zones = (1.5, 9) Returns: Type Description list [ float ] list[float]: list with total width corresponding to each provided zone.","title":"get_total_infrastructure_per_zone()"},{"location":"reference/koswat_docstrings/dike/surroundings.html#koswat.dike.surroundings.wrapper.obstacle_surroundings_wrapper.SurroundingsObstacle","text":"Bases: KoswatSurroundingsProtocol Defines surroundings point collections that cannot be repaired or replaced. The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a 1 (obstacle present) or a 0 (obstacle not present).","title":"SurroundingsObstacle"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html","text":"Reinforcement Layers Wrapper \u00b6 KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. get_polygon_coordinates ( pol_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry. ReinforcementCoatingLayer \u00b6 Bases: ReinforcementLayerProtocol with_same_outer_geometry ( coating_layer : KoswatCoatingLayer ) -> ReinforcementCoatingLayer classmethod \u00b6 Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries. get_polygon_coordinates ( pol_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry. KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ). ReinforcementCoatingLayer \u00b6 Bases: ReinforcementLayerProtocol with_same_outer_geometry ( coating_layer : KoswatCoatingLayer ) -> ReinforcementCoatingLayer classmethod \u00b6 Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatLayersWrapperBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> KoswatLayersWrapperProtocol \u00b6 Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol . KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ). OutsideSlopeReinforcementLayersWrapperBuilder \u00b6 Bases: KoswatLayersWrapperBuilderProtocol ReinforcementCoatingLayer \u00b6 Bases: ReinforcementLayerProtocol with_same_outer_geometry ( coating_layer : KoswatCoatingLayer ) -> ReinforcementCoatingLayer classmethod \u00b6 Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . get_polygon_surface_points ( base_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry. KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatLayersWrapperBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> KoswatLayersWrapperProtocol \u00b6 Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol . KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ). ReinforcementCoatingLayer \u00b6 Bases: ReinforcementLayerProtocol with_same_outer_geometry ( coating_layer : KoswatCoatingLayer ) -> ReinforcementCoatingLayer classmethod \u00b6 Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . StandardReinforcementLayersWrapperBuilder \u00b6 Bases: KoswatLayersWrapperBuilderProtocol as_unified_geometry ( source_geom : geometry . Polygon | geometry . MultiPolygon ) -> geometry . Polygon \u00b6 Ensures the calculated geometry is returned as a single polygon. Parameters: Name Type Description Default source_geom geometry . Polygon | geometry . MultiPolygon Calculated source geometry. required Returns: Type Description geometry . Polygon geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate). get_normalized_polygon_difference ( left_geom : geometry . Polygon , right_geom : geometry . Polygon ) -> geometry . Polygon | geometry . MultiPolygon \u00b6 Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors. Parameters: Name Type Description Default left_geom geometry . Polygon Base polygon from where to substract. required right_geom geometry . Polygon Polygon to substract from base. required Returns: Type Description geometry . Polygon | geometry . MultiPolygon geometry.Polygon: Resulting normalized substraction polygon. get_polygon_surface_points ( base_geometry : geometry . Polygon | geometry . MultiPolygon ) -> geometry . LineString \u00b6 Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry. get_relative_core_layer ( core_geometry : geometry . Polygon , coating_geometry : geometry . Polygon ) -> geometry . Polygon \u00b6 Returns a new 'core' from the original core_geometry relative to the coating_geometry . Parameters: Name Type Description Default core_geometry Polygon Original core geometry on which layers are stacked upon. required coating_geometry Polygon Layer wrapping the exterior of a core geometry. required Returns: Name Type Description Polygon geometry . Polygon Layer wrapping a reduced surface of the core_geometry .","title":"Reinforcement Layers Wrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#reinforcement-layers-wrapper","text":"","title":"Reinforcement Layers Wrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layer_protocol.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_base_layer.get_polygon_coordinates","text":"Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry.","title":"get_polygon_coordinates()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.ReinforcementCoatingLayer","text":"Bases: ReinforcementLayerProtocol","title":"ReinforcementCoatingLayer"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.ReinforcementCoatingLayer.with_same_outer_geometry","text":"Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries.","title":"with_same_outer_geometry()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.get_polygon_coordinates","text":"Given a single or multi geometry returns the coordinates composing its outer layout. Parameters: Name Type Description Default pol_geometry geometry . Polygon | geometry . MultiPolygon Source geometry. required Raises: Type Description NotImplementedError When the provided geometry is not yet supported. Returns: Type Description geometry . LineString geometry.LineString: Set of points composing the outer layout of the geometry.","title":"get_polygon_coordinates()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementCoatingLayer","text":"Bases: ReinforcementLayerProtocol","title":"ReinforcementCoatingLayer"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.ReinforcementCoatingLayer.with_same_outer_geometry","text":"Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries.","title":"with_same_outer_geometry()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.KoswatLayersWrapperBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"KoswatLayersWrapperBuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.KoswatLayersWrapperBuilderProtocol.build","text":"Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.OutsideSlopeReinforcementLayersWrapperBuilder","text":"Bases: KoswatLayersWrapperBuilderProtocol","title":"OutsideSlopeReinforcementLayersWrapperBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.ReinforcementCoatingLayer","text":"Bases: ReinforcementLayerProtocol","title":"ReinforcementCoatingLayer"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.ReinforcementCoatingLayer.with_same_outer_geometry","text":"Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries.","title":"with_same_outer_geometry()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.outside_slope_reinforcement_layers_wrapper_builder.get_polygon_surface_points","text":"Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry.","title":"get_polygon_surface_points()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.KoswatLayersWrapperBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"KoswatLayersWrapperBuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_builder_protocol.KoswatLayersWrapperBuilderProtocol.build","text":"Builds an instance of KoswatLayersWrapperProtocol based on the class required fields layers_data and profile_points . Returns: Name Type Description KoswatLayersWrapperProtocol KoswatLayersWrapperProtocol Valid initialized instance of a KoswatLayersWrapperProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.ReinforcementCoatingLayer","text":"Bases: ReinforcementLayerProtocol","title":"ReinforcementCoatingLayer"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_coating_layer.ReinforcementCoatingLayer.with_same_outer_geometry","text":"Creates a new reinforcement coating layer which does not differ in geometry from the provided coating layer. This was found to be needed in KOSWAT_82. Parameters: Name Type Description Default coating_layer KoswatCoatingLayer Base coating layer. required Returns: Name Type Description ReinforcementCoatingLayer ReinforcementCoatingLayer Resulting coating layer with \"empty\" ReinforcementCoatingLayer polygons for added / removed (layer) geometries.","title":"with_same_outer_geometry()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.StandardReinforcementLayersWrapperBuilder","text":"Bases: KoswatLayersWrapperBuilderProtocol","title":"StandardReinforcementLayersWrapperBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.as_unified_geometry","text":"Ensures the calculated geometry is returned as a single polygon. Parameters: Name Type Description Default source_geom geometry . Polygon | geometry . MultiPolygon Calculated source geometry. required Returns: Type Description geometry . Polygon geometry.Polygon: Unified resulting geometry with its points ordered (first one is the most-left x coordinate).","title":"as_unified_geometry()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.get_normalized_polygon_difference","text":"Given two polygons calculates the difference between them and removes any residual polygon due to minor precision errors. Parameters: Name Type Description Default left_geom geometry . Polygon Base polygon from where to substract. required right_geom geometry . Polygon Polygon to substract from base. required Returns: Type Description geometry . Polygon | geometry . MultiPolygon geometry.Polygon: Resulting normalized substraction polygon.","title":"get_normalized_polygon_difference()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.get_polygon_surface_points","text":"Gets all the points composing the upper surface of a 'dike' geometry. IMPORTANT! The calling of this method assumes the base_geometry points are in order, call order_geometry_points if needed. Parameters: Name Type Description Default base_geometry Union [ geometry . Polygon , geometry . MultiPolygon ] Source geometry. required Returns: Type Description geometry . LineString geometry.LineString: Resulting line with points from the outer geometry.","title":"get_polygon_surface_points()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_layers.html#koswat.dike_reinforcements.reinforcement_layers.standard_reinforcement_layers_wrapper_builder.get_relative_core_layer","text":"Returns a new 'core' from the original core_geometry relative to the coating_geometry . Parameters: Name Type Description Default core_geometry Polygon Original core geometry on which layers are stacked upon. required coating_geometry Polygon Layer wrapping the exterior of a core geometry. required Returns: Name Type Description Polygon geometry . Polygon Layer wrapping a reduced surface of the core_geometry .","title":"get_relative_core_layer()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html","text":"Reinforcement profile \u00b6 KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. ReinforcementInputProfileCalculationProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementInputProfileProtocol \u00b6 Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile. ReinforcementInputProfileProtocol \u00b6 Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol . reinforcement_domain_name : str property \u00b6 Returns the representative name in the \"real\" world of this reinforcement. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . ReinforcementProfileBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementProfileProtocol \u00b6 Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol . KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. ReinforcementProfileBuilderFactory \u00b6 get_available_reinforcements () -> list [ ReinforcementProfileProtocol ] staticmethod \u00b6 Gets all available reinforcements defined in Koswat. Returns: Type Description list [ ReinforcementProfileProtocol ] List[ReinforcementProfileProtocol]: List of reinforcement profile protocols types. get_reinforcement_builder ( reinforcement_profile_type : type [ ReinforcementProfileProtocol ]) -> ReinforcementProfileBuilderProtocol staticmethod \u00b6 Gets a valid reinforcement profile builder instance ( ReinforcementProfileBuilderProtocol ). Parameters: Name Type Description Default reinforcement_profile_type Type [ ReinforcementProfileProtocol ] Type that requires a builder. required Raises: Type Description NotImplementedError When there is no builder associated to the given reinforcement_profile_type . Returns: Name Type Description ReinforcementProfileBuilderProtocol ReinforcementProfileBuilderProtocol Valid instance of a ReinforcementProfileBuilderProtocol . ReinforcementProfileBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementProfileProtocol \u00b6 Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol . ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. StandardReinforcementProfileBuilder \u00b6 Bases: ReinforcementProfileBuilderBase get_input_profile_calculator ( reinforcement_type : type [ StandardReinforcementProfile ]) -> ReinforcementInputProfileCalculationProtocol staticmethod \u00b6 Get the input profile calculator for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ StandardReinforcementProfile ] The reinforcement type. required Raises: Type Description NotImplementedError The given reinforcement type is not supported. Returns: Name Type Description ReinforcementInputProfileCalculationProtocol ReinforcementInputProfileCalculationProtocol The input profile calculator. BuilderProtocol \u00b6 Bases: Protocol build () -> Any \u00b6 Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain. KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. ReinforcementProfileBuilderProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementProfileProtocol \u00b6 Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol . ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. ReinforcementInputProfileProtocol \u00b6 Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol . reinforcement_domain_name : str property \u00b6 Returns the representative name in the \"real\" world of this reinforcement. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. ReinforcementInputProfileProtocol \u00b6 Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol . reinforcement_domain_name : str property \u00b6 Returns the representative name in the \"real\" world of this reinforcement. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . ReinforcementProfileProtocol \u00b6 Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement. Outside slope \u00b6 ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . CofferdamInputProfileCalculation \u00b6 Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. OutsideSlopeReinforcementLayersWrapperBuilder \u00b6 Bases: KoswatLayersWrapperBuilderProtocol ReinforcementInputProfileCalculationProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementInputProfileProtocol \u00b6 Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile. ReinforcementInputProfileProtocol \u00b6 Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol . reinforcement_domain_name : str property \u00b6 Returns the representative name in the \"real\" world of this reinforcement. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . Standard \u00b6 ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . KoswatProfileBase dataclass \u00b6 Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made. points : list [ Point ] property \u00b6 The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile . profile_height : float property \u00b6 The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate. profile_width : float property \u00b6 The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance. OutsideSlopeReinforcementLayersWrapperBuilder \u00b6 Bases: KoswatLayersWrapperBuilderProtocol PipingWallInputProfileCalculation \u00b6 Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol ReinforcementInputProfileCalculationProtocol \u00b6 Bases: BuilderProtocol , Protocol build () -> ReinforcementInputProfileProtocol \u00b6 Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile. ReinforcementInputProfileProtocol \u00b6 Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol . reinforcement_domain_name : str property \u00b6 Returns the representative name in the \"real\" world of this reinforcement. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol . SoilInputProfileCalculation \u00b6 Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol StabilityWallInputProfileCalculation \u00b6 Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol StandardReinforcementLayersWrapperBuilder \u00b6 Bases: KoswatLayersWrapperBuilderProtocol StandardReinforcementProfileBuilder \u00b6 Bases: ReinforcementProfileBuilderBase get_input_profile_calculator ( reinforcement_type : type [ StandardReinforcementProfile ]) -> ReinforcementInputProfileCalculationProtocol staticmethod \u00b6 Get the input profile calculator for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ StandardReinforcementProfile ] The reinforcement type. required Raises: Type Description NotImplementedError The given reinforcement type is not supported. Returns: Name Type Description ReinforcementInputProfileCalculationProtocol ReinforcementInputProfileCalculationProtocol The input profile calculator. ReinforcementLayersWrapper \u00b6 Bases: KoswatLayersWrapperProtocol layers : list [ ReinforcementLayerProtocol ] property \u00b6 All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"Reinforcement profile"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#reinforcement-profile","text":"","title":"Reinforcement profile"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_base.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_base.ReinforcementInputProfileCalculationProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementInputProfileCalculationProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_calculation_protocol.ReinforcementInputProfileCalculationProtocol.build","text":"Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile.","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_base.ReinforcementInputProfileProtocol","text":"Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol .","title":"ReinforcementInputProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_protocol.ReinforcementInputProfileProtocol.reinforcement_domain_name","text":"Returns the representative name in the \"real\" world of this reinforcement.","title":"reinforcement_domain_name"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_base.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_base.ReinforcementProfileBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementProfileBuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.ReinforcementProfileBuilderProtocol.build","text":"Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.ReinforcementProfileBuilderFactory","text":"","title":"ReinforcementProfileBuilderFactory"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.ReinforcementProfileBuilderFactory.get_available_reinforcements","text":"Gets all available reinforcements defined in Koswat. Returns: Type Description list [ ReinforcementProfileProtocol ] List[ReinforcementProfileProtocol]: List of reinforcement profile protocols types.","title":"get_available_reinforcements()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.ReinforcementProfileBuilderFactory.get_reinforcement_builder","text":"Gets a valid reinforcement profile builder instance ( ReinforcementProfileBuilderProtocol ). Parameters: Name Type Description Default reinforcement_profile_type Type [ ReinforcementProfileProtocol ] Type that requires a builder. required Raises: Type Description NotImplementedError When there is no builder associated to the given reinforcement_profile_type . Returns: Name Type Description ReinforcementProfileBuilderProtocol ReinforcementProfileBuilderProtocol Valid instance of a ReinforcementProfileBuilderProtocol .","title":"get_reinforcement_builder()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.ReinforcementProfileBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementProfileBuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.ReinforcementProfileBuilderProtocol.build","text":"Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_factory.StandardReinforcementProfileBuilder","text":"Bases: ReinforcementProfileBuilderBase","title":"StandardReinforcementProfileBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.StandardReinforcementProfileBuilder.get_input_profile_calculator","text":"Get the input profile calculator for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ StandardReinforcementProfile ] The reinforcement type. required Raises: Type Description NotImplementedError The given reinforcement type is not supported. Returns: Name Type Description ReinforcementInputProfileCalculationProtocol ReinforcementInputProfileCalculationProtocol The input profile calculator.","title":"get_input_profile_calculator()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.BuilderProtocol","text":"Bases: Protocol","title":"BuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.core.protocols.builder_protocol.BuilderProtocol.build","text":"Instantiates a concrete object to separate its initalization from the data structure. Returns: Name Type Description Any Any Intance of a created object within Koswat domain.","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.ReinforcementProfileBuilderProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementProfileBuilderProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.ReinforcementProfileBuilderProtocol.build","text":"Builds a concrete instance of a ReinforcementProfileProtocol based on the required data. Returns: Name Type Description ReinforcementProfileProtocol ReinforcementProfileProtocol Valid instance of a ReinforcementProfileProtocol .","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_builder_protocol.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_protocol.ReinforcementInputProfileProtocol","text":"Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol .","title":"ReinforcementInputProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_protocol.ReinforcementInputProfileProtocol.reinforcement_domain_name","text":"Returns the representative name in the \"real\" world of this reinforcement.","title":"reinforcement_domain_name"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_protocol.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile_protocol.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile.ReinforcementInputProfileProtocol","text":"Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol .","title":"ReinforcementInputProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_protocol.ReinforcementInputProfileProtocol.reinforcement_domain_name","text":"Returns the representative name in the \"real\" world of this reinforcement.","title":"reinforcement_domain_name"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.reinforcement_profile.ReinforcementProfileProtocol","text":"Bases: KoswatProfileProtocol , Protocol Extension of the KoswatProfileProtocol to define the properties of a calculated reinforcement.","title":"ReinforcementProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#outside-slope","text":"","title":"Outside slope"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.cofferdam_reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.CofferdamInputProfileCalculation","text":"Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol","title":"CofferdamInputProfileCalculation"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.OutsideSlopeReinforcementLayersWrapperBuilder","text":"Bases: KoswatLayersWrapperBuilderProtocol","title":"OutsideSlopeReinforcementLayersWrapperBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.ReinforcementInputProfileCalculationProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementInputProfileCalculationProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_calculation_protocol.ReinforcementInputProfileCalculationProtocol.build","text":"Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile.","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.ReinforcementInputProfileProtocol","text":"Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol .","title":"ReinforcementInputProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_protocol.ReinforcementInputProfileProtocol.reinforcement_domain_name","text":"Returns the representative name in the \"real\" world of this reinforcement.","title":"reinforcement_domain_name"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.outside_slope.outside_slope_reinforcement_profile_builder.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#standard","text":"","title":"Standard"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.piping_wall_reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.soil_reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.stability_wall_reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.KoswatProfileBase","text":"Bases: KoswatProfileProtocol Basic definition and implementation of a KoswatProfileProtocol . It represents the initial koswat profile being provided by the user from which further calculations will be made.","title":"KoswatProfileBase"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.points","text":"The combination of points from both water and polder sides. Returns: Type Description list [ Point ] list[Point]: A total of eight points comforming the KoswatProfile .","title":"points"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_height","text":"The profile highest point (largest y-coordinate). Returns: Name Type Description float float Greatest y-coordinate.","title":"profile_height"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike.profile.koswat_profile.KoswatProfileBase.profile_width","text":"The profile extent from the lowest (left-most) x-coordinate to the largest (right-most) x-coordinate from a dike geometry polygon. Returns: Name Type Description float float Total distance.","title":"profile_width"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.OutsideSlopeReinforcementLayersWrapperBuilder","text":"Bases: KoswatLayersWrapperBuilderProtocol","title":"OutsideSlopeReinforcementLayersWrapperBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.PipingWallInputProfileCalculation","text":"Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol","title":"PipingWallInputProfileCalculation"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.ReinforcementInputProfileCalculationProtocol","text":"Bases: BuilderProtocol , Protocol","title":"ReinforcementInputProfileCalculationProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_calculation_protocol.ReinforcementInputProfileCalculationProtocol.build","text":"Builds a ReinforcementInputProfileProtocol instance based on the base_profile and scenario specified in this class. Returns: Name Type Description ReinforcementInputProfileProtocol ReinforcementInputProfileProtocol Calculated reinforcement input profile.","title":"build()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.ReinforcementInputProfileProtocol","text":"Bases: KoswatInputProfileProtocol , Protocol Just an alias to distinguish from a regular KoswatInputProfileProtocol .","title":"ReinforcementInputProfileProtocol"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.input_profile.reinforcement_input_profile_protocol.ReinforcementInputProfileProtocol.reinforcement_domain_name","text":"Returns the representative name in the \"real\" world of this reinforcement.","title":"reinforcement_domain_name"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.SoilInputProfileCalculation","text":"Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol","title":"SoilInputProfileCalculation"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.StabilityWallInputProfileCalculation","text":"Bases: ReinforcementInputProfileCalculationBase , ReinforcementInputProfileCalculationProtocol","title":"StabilityWallInputProfileCalculation"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.StandardReinforcementLayersWrapperBuilder","text":"Bases: KoswatLayersWrapperBuilderProtocol","title":"StandardReinforcementLayersWrapperBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.StandardReinforcementProfileBuilder","text":"Bases: ReinforcementProfileBuilderBase","title":"StandardReinforcementProfileBuilder"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.standard_reinforcement_profile_builder.StandardReinforcementProfileBuilder.get_input_profile_calculator","text":"Get the input profile calculator for the given reinforcement type. Parameters: Name Type Description Default reinforcement_type type [ StandardReinforcementProfile ] The reinforcement type. required Raises: Type Description NotImplementedError The given reinforcement type is not supported. Returns: Name Type Description ReinforcementInputProfileCalculationProtocol ReinforcementInputProfileCalculationProtocol The input profile calculator.","title":"get_input_profile_calculator()"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_profile.standard.vps_reinforcement_profile.ReinforcementLayersWrapper","text":"Bases: KoswatLayersWrapperProtocol","title":"ReinforcementLayersWrapper"},{"location":"reference/koswat_docstrings/dike_reinforcements/reinforcement_profile.html#koswat.dike_reinforcements.reinforcement_layers.reinforcement_layers_wrapper.ReinforcementLayersWrapper.layers","text":"All the stored layers being the KoswatBaseLayer the latest one in the collection. Returns: Type Description list [ ReinforcementLayerProtocol ] List[KoswatLayerProtocol]: Ordered list of KoswatLayerProtocol .","title":"layers"},{"location":"reference/koswat_docstrings/plots/dike.html","text":"Dike plotting module \u00b6 KoswatLayerPlot \u00b6 Bases: KoswatPlotProtocol plot ( color : str ) -> None \u00b6 Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color . Parameters: Name Type Description Default color str Color code. required return list( map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) ) ValueError: When the KoswatLayerProtocol material has not been registered. KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object . KoswatLayerPlot \u00b6 Bases: KoswatPlotProtocol plot ( color : str ) -> None \u00b6 Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color . Parameters: Name Type Description Default color str Color code. required return list( map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) ) ValueError: When the KoswatLayerProtocol material has not been registered. KoswatLayerProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data. KoswatLayersWrapperPlot \u00b6 Bases: KoswatPlotProtocol with_layers_list ( layers_list : List [ KoswatLayerProtocol ]) -> KoswatLayersWrapperPlot classmethod \u00b6 Class method to aid the usage of this class with unrelated layers from different wrappers. Parameters: Name Type Description Default layers_list List [ KoswatLayerProtocol ] List of layers to wrap just for plotting. required Returns: Name Type Description KoswatLayersWrapperPlot KoswatLayersWrapperPlot Initialized valid instance with custom intenal wrapper PlotLayersWrapper . KoswatLayersWrapperProtocol \u00b6 Bases: Protocol as_data_dict () -> dict \u00b6 Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ). KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object . get_cmap ( n_colors : int , name : int = 'hsv' ) \u00b6 Returns a function that maps each index in 0, 1, ..., n-1 to a distinct RGB color; the keyword argument name must be a standard mpl colormap name. KoswatLayersWrapperPlot \u00b6 Bases: KoswatPlotProtocol with_layers_list ( layers_list : List [ KoswatLayerProtocol ]) -> KoswatLayersWrapperPlot classmethod \u00b6 Class method to aid the usage of this class with unrelated layers from different wrappers. Parameters: Name Type Description Default layers_list List [ KoswatLayerProtocol ] List of layers to wrap just for plotting. required Returns: Name Type Description KoswatLayersWrapperPlot KoswatLayersWrapperPlot Initialized valid instance with custom intenal wrapper PlotLayersWrapper . KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object . KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"Dike plotting module"},{"location":"reference/koswat_docstrings/plots/dike.html#dike-plotting-module","text":"","title":"Dike plotting module"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layer_plot.KoswatLayerPlot","text":"Bases: KoswatPlotProtocol","title":"KoswatLayerPlot"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layer_plot.KoswatLayerPlot.plot","text":"Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color . Parameters: Name Type Description Default color str Color code. required return list( map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) ) ValueError: When the KoswatLayerProtocol material has not been registered.","title":"plot()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layer_plot.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layer_plot.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayerPlot","text":"Bases: KoswatPlotProtocol","title":"KoswatLayerPlot"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layer_plot.KoswatLayerPlot.plot","text":"Plots a KoswatLayerProtocol into the provided canvas plot_axes with the requested color . Parameters: Name Type Description Default color str Color code. required return list( map(concatenate, zip(*map(lambda x: x.coords.xy, koswat_geometry.geoms))) ) ValueError: When the KoswatLayerProtocol material has not been registered.","title":"plot()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayerProtocol","text":"Bases: Protocol","title":"KoswatLayerProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.dike.layers.koswat_layer_protocol.KoswatLayerProtocol.as_data_dict","text":"Returns the information related to an instance of the KoswatLayerProtocol . Returns: Name Type Description dict dict custom dictionary with the relevant data.","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayersWrapperPlot","text":"Bases: KoswatPlotProtocol","title":"KoswatLayersWrapperPlot"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayersWrapperPlot.with_layers_list","text":"Class method to aid the usage of this class with unrelated layers from different wrappers. Parameters: Name Type Description Default layers_list List [ KoswatLayerProtocol ] List of layers to wrap just for plotting. required Returns: Name Type Description KoswatLayersWrapperPlot KoswatLayersWrapperPlot Initialized valid instance with custom intenal wrapper PlotLayersWrapper .","title":"with_layers_list()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayersWrapperProtocol","text":"Bases: Protocol","title":"KoswatLayersWrapperProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.dike.layers.layers_wrapper.koswat_layers_wrapper_protocol.KoswatLayersWrapperProtocol.as_data_dict","text":"Returns the layers as a dictionary. Returns: Name Type Description dict dict Dictionary containing all the information of the wrapper layers ( KoswatLayerProtocol ).","title":"as_data_dict()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.get_cmap","text":"Returns a function that maps each index in 0, 1, ..., n-1 to a distinct RGB color; the keyword argument name must be a standard mpl colormap name.","title":"get_cmap()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_profile_plot.KoswatLayersWrapperPlot","text":"Bases: KoswatPlotProtocol","title":"KoswatLayersWrapperPlot"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_layers_wrapper_plot.KoswatLayersWrapperPlot.with_layers_list","text":"Class method to aid the usage of this class with unrelated layers from different wrappers. Parameters: Name Type Description Default layers_list List [ KoswatLayerProtocol ] List of layers to wrap just for plotting. required Returns: Name Type Description KoswatLayersWrapperPlot KoswatLayersWrapperPlot Initialized valid instance with custom intenal wrapper PlotLayersWrapper .","title":"with_layers_list()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.koswat_profile_plot.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.dike.list_koswat_profile_plot.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/dike.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/geometries.html","text":"Geometries plot module \u00b6 HighlightGeometryPlot \u00b6 Bases: KoswatPlotProtocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a layer highlighting its content. Returns: Type Description pyplot . axes pyplot.axes: Polygon with its area painted. KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"Geometries plot module"},{"location":"reference/koswat_docstrings/plots/geometries.html#geometries-plot-module","text":"","title":"Geometries plot module"},{"location":"reference/koswat_docstrings/plots/geometries.html#koswat.plots.geometries.highlight_geometry_plot.HighlightGeometryPlot","text":"Bases: KoswatPlotProtocol","title":"HighlightGeometryPlot"},{"location":"reference/koswat_docstrings/plots/geometries.html#koswat.plots.geometries.highlight_geometry_plot.HighlightGeometryPlot.plot","text":"Plots a layer highlighting its content. Returns: Type Description pyplot . axes pyplot.axes: Polygon with its area painted.","title":"plot()"},{"location":"reference/koswat_docstrings/plots/geometries.html#koswat.plots.geometries.highlight_geometry_plot.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/geometries.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/plots.html","text":"Plots module \u00b6 KoswatFigureContextHandler \u00b6 PyPlot fig context handler that opens the figure stream and closes it saving it to the appointed path. Usage example with KoswatFigureContext(Path(\"C://my_plot.png\"), 42) as _figure: _subplot = _figure.add_subplot() ... __enter__ () -> Figure \u00b6 Access to the context and invokation of pyplot.figure(dpi) . Returns: Name Type Description Figure Figure Initialized instance from pyplot.figure(dpi=dpi) . __exit__ ( * args , ** kwargs ) -> None \u00b6 Exit the current context and save the previously initialized Figure . __init__ ( output_path : Path , dpi : int ) -> None \u00b6 Initializes the context by invoking pyplot.figure(dpi=dpi) and saving its output to an internal field. Parameters: Name Type Description Default output_path Path Export location for the generated plot. required dpi int Canvas resolution in dots-per-inch. required KoswatPlotProtocol \u00b6 Bases: Protocol plot ( * args , ** kwargs ) -> pyplot . axes \u00b6 Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object . KoswatExporterProtocol \u00b6 Bases: Protocol export ( ** kwargs ) -> None \u00b6 Exports an object model into a concrete file format. PlotExporterProtocol \u00b6 Bases: KoswatExporterProtocol , Protocol export () -> None \u00b6 Exports a given object into a plot.","title":"Plots module"},{"location":"reference/koswat_docstrings/plots/plots.html#plots-module","text":"","title":"Plots module"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_figure_context_handler.KoswatFigureContextHandler","text":"PyPlot fig context handler that opens the figure stream and closes it saving it to the appointed path. Usage example with KoswatFigureContext(Path(\"C://my_plot.png\"), 42) as _figure: _subplot = _figure.add_subplot() ...","title":"KoswatFigureContextHandler"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_figure_context_handler.KoswatFigureContextHandler.__enter__","text":"Access to the context and invokation of pyplot.figure(dpi) . Returns: Name Type Description Figure Figure Initialized instance from pyplot.figure(dpi=dpi) .","title":"__enter__()"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_figure_context_handler.KoswatFigureContextHandler.__exit__","text":"Exit the current context and save the previously initialized Figure .","title":"__exit__()"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_figure_context_handler.KoswatFigureContextHandler.__init__","text":"Initializes the context by invoking pyplot.figure(dpi=dpi) and saving its output to an internal field. Parameters: Name Type Description Default output_path Path Export location for the generated plot. required dpi int Canvas resolution in dots-per-inch. required","title":"__init__()"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol","text":"Bases: Protocol","title":"KoswatPlotProtocol"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.koswat_plot_protocol.KoswatPlotProtocol.plot","text":"Plots a koswat_object into the provided plot ax with the requested *args and **kwargs . Returns: Type Description pyplot . axes pyplot.axes: Canvas with plotted koswat_object .","title":"plot()"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.plot_exporter_protocol.KoswatExporterProtocol","text":"Bases: Protocol","title":"KoswatExporterProtocol"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.core.io.koswat_exporter_protocol.KoswatExporterProtocol.export","text":"Exports an object model into a concrete file format.","title":"export()"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.plot_exporter_protocol.PlotExporterProtocol","text":"Bases: KoswatExporterProtocol , Protocol","title":"PlotExporterProtocol"},{"location":"reference/koswat_docstrings/plots/plots.html#koswat.plots.plot_exporter_protocol.PlotExporterProtocol.export","text":"Exports a given object into a plot.","title":"export()"}]} \ No newline at end of file diff --git a/search/worker.js b/search/worker.js new file mode 100644 index 00000000..8628dbce --- /dev/null +++ b/search/worker.js @@ -0,0 +1,133 @@ +var base_path = 'function' === typeof importScripts ? '.' : '/search/'; +var allowSearch = false; +var index; +var documents = {}; +var lang = ['en']; +var data; + +function getScript(script, callback) { + console.log('Loading script: ' + script); + $.getScript(base_path + script).done(function () { + callback(); + }).fail(function (jqxhr, settings, exception) { + console.log('Error: ' + exception); + }); +} + +function getScriptsInOrder(scripts, callback) { + if (scripts.length === 0) { + callback(); + return; + } + getScript(scripts[0], function() { + getScriptsInOrder(scripts.slice(1), callback); + }); +} + +function loadScripts(urls, callback) { + if( 'function' === typeof importScripts ) { + importScripts.apply(null, urls); + callback(); + } else { + getScriptsInOrder(urls, callback); + } +} + +function onJSONLoaded () { + data = JSON.parse(this.responseText); + var scriptsToLoad = ['lunr.js']; + if (data.config && data.config.lang && data.config.lang.length) { + lang = data.config.lang; + } + if (lang.length > 1 || lang[0] !== "en") { + scriptsToLoad.push('lunr.stemmer.support.js'); + if (lang.length > 1) { + scriptsToLoad.push('lunr.multi.js'); + } + if (lang.includes("ja") || lang.includes("jp")) { + scriptsToLoad.push('tinyseg.js'); + } + for (var i=0; i < lang.length; i++) { + if (lang[i] != 'en') { + scriptsToLoad.push(['lunr', lang[i], 'js'].join('.')); + } + } + } + loadScripts(scriptsToLoad, onScriptsLoaded); +} + +function onScriptsLoaded () { + console.log('All search scripts loaded, building Lunr index...'); + if (data.config && data.config.separator && data.config.separator.length) { + lunr.tokenizer.separator = new RegExp(data.config.separator); + } + + if (data.index) { + index = lunr.Index.load(data.index); + data.docs.forEach(function (doc) { + documents[doc.location] = doc; + }); + console.log('Lunr pre-built index loaded, search ready'); + } else { + index = lunr(function () { + if (lang.length === 1 && lang[0] !== "en" && lunr[lang[0]]) { + this.use(lunr[lang[0]]); + } else if (lang.length > 1) { + this.use(lunr.multiLanguage.apply(null, lang)); // spread operator not supported in all browsers: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator#Browser_compatibility + } + this.field('title'); + this.field('text'); + this.ref('location'); + + for (var i=0; i < data.docs.length; i++) { + var doc = data.docs[i]; + this.add(doc); + documents[doc.location] = doc; + } + }); + console.log('Lunr index built, search ready'); + } + allowSearch = true; + postMessage({config: data.config}); + postMessage({allowSearch: allowSearch}); +} + +function init () { + var oReq = new XMLHttpRequest(); + oReq.addEventListener("load", onJSONLoaded); + var index_path = base_path + '/search_index.json'; + if( 'function' === typeof importScripts ){ + index_path = 'search_index.json'; + } + oReq.open("GET", index_path); + oReq.send(); +} + +function search (query) { + if (!allowSearch) { + console.error('Assets for search still loading'); + return; + } + + var resultDocuments = []; + var results = index.search(query); + for (var i=0; i < results.length; i++){ + var result = results[i]; + doc = documents[result.ref]; + doc.summary = doc.text.substring(0, 200); + resultDocuments.push(doc); + } + return resultDocuments; +} + +if( 'function' === typeof importScripts ) { + onmessage = function (e) { + if (e.data.init) { + init(); + } else if (e.data.query) { + postMessage({ results: search(e.data.query) }); + } else { + console.error("Worker - Unrecognized message: " + e); + } + }; +} diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 00000000..0f8724ef --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 00000000..d5543802 Binary files /dev/null and b/sitemap.xml.gz differ diff --git a/user_manual.html b/user_manual.html new file mode 100644 index 00000000..8a769b2b --- /dev/null +++ b/user_manual.html @@ -0,0 +1,333 @@ + + + + + + + + User manual - Koswat + + + + + + + + + + + + + + + +
+ + +
+ +
+
+ +
+
+
+
+ +

User manual

+

As a command line tool

+

When using Koswat as a package you can run it directly from the command line as follows:

+

python -m koswat --input_file path\\to\\your\\koswat.ini --log_output path\\to\\your\\output\\dir
+
+The arguments are:

+
    +
  • --input_file (required): Absolute path to the location of your general koswat.ini file.
  • +
  • --log_output (optional): Absolute path to the location of where the koswat.log will be written. If not specified it will be written at the root of the execution directory.
  • +
+

It is also possible to check all the above possibilities via the --help argument in the command line: +

python -m koswat --help
+

+

As a sandbox

+

It is entirely possible to make a custom Koswat analysis using the tool as a sandbox. This means, through a script calling the different classes to generate an analysis.

+

As a simple example, we can rewrite the acceptance test test_given_surrounding_files_run_calculations_for_all_included_profiles:

+
from koswat.dike.profile.koswat_input_profile_base import KoswatInputProfileBase
+from koswat.dike.material.koswat_material_type import KoswatMaterialType
+from koswat.configuration.settings.koswat_scenario import KoswatScenario
+from koswat.dike.profile import KoswatProfileBase, KoswatProfileBuilder
+from koswat.cost_report.summary import KoswatSummary, KoswatSummaryBuilder
+from koswat.configuration.settings.koswat_run_scenario_settings import (
+    KoswatRunScenarioSettings,
+)
+from koswat.cost_report.io.summary.koswat_summary_exporter import KoswatSummaryExporter
+from koswat.cost_report.io.plots.multi_location_profile_comparison_plot_exporter import (
+    MultiLocationProfileComparisonPlotExporter,
+)
+from koswat.dike_reinforcements import ReinforcementProfileBuilderFactory
+
+# 1. Define input data.
+_input_dir = Path("C:\\my_koswat_input_dir")
+_output_dir = Path("C:\\my_koswat_results")
+_shp_trajects_file = (
+    _input_dir
+    / "Dijkvak"
+    / "Dijkringlijnen_KOSWAT_Totaal_2017_10_3_Dijkvak.shp"
+)
+assert _shp_trajects_file.is_file()
+
+## Define input profile case
+input_profile_case = KoswatInputProfileBase()
+input_profile_case.dike_section = "test_data"
+input_profile_case.waterside_ground_level = 0
+input_profile_case.waterside_slope = 3
+input_profile_case.waterside_berm_width = 0
+input_profile_case.waterside_berm_height = 0
+input_profile_case.crest_height = 6
+input_profile_case.crest_width = 5
+input_profile_case.polderside_slope = 3
+input_profile_case.polderside_berm_height = 0
+input_profile_case.polderside_berm_width = 0
+input_profile_case.polderside_ground_level = 0
+input_profile_case.pleistocene = -5
+input_profile_case.aquifer = -2
+
+## Define the scenario case
+scenario_case = KoswatScenario()
+scenario_case.scenario_name = ""
+scenario_case.scenario_section = ""
+scenario_case.d_h = 1
+scenario_case.d_s = 10
+scenario_case.d_p = 30
+scenario_case.crest_width = 5
+scenario_case.waterside_slope = 3
+
+## Define the layers case
+layers_case = dict(
+        base_layer=dict(material=KoswatMaterialType.SAND),
+        coating_layers=[
+            dict(material=KoswatMaterialType.GRASS, depth=0.3),
+            dict(material=KoswatMaterialType.CLAY, depth=0.5),
+        ],
+    )
+
+## Import surroundings (TODO: update with latest implementation of SurroundingsWrapperCollectionImporter)
+_surroundings_importer = KoswatSurroundingsImporter()
+_surroundings_importer.traject_loc_shp_file = _shp_trajects_file
+_surroundings = _surroundings_importer.import_from(_test_dir)[0]
+
+assert isinstance(scenario_case, KoswatScenario)
+_base_koswat_profile = KoswatProfileBuilder.with_data(
+    dict(
+        input_profile_data=input_profile_case,
+        layers_data=layers_case,
+        profile_type=KoswatProfileBase,
+    )
+).build()
+
+## Define the run settings based on the previous calculated parameters.
+_run_settings = KoswatRunScenarioSettings()
+_run_settings.scenario = scenario_case
+_run_settings.surroundings = _surroundings
+_run_settings.input_profile_case = _base_koswat_profile
+
+# 2. Run summary
+_multi_loc_multi_prof_cost_builder = KoswatSummaryBuilder()
+_multi_loc_multi_prof_cost_builder.run_scenario_settings = _run_settings
+_summary = _multi_loc_multi_prof_cost_builder.build()
+
+KoswatSummaryExporter().export(_summary, _output_dir)
+
+# 3. Generate plots
+assert isinstance(_summary, KoswatSummary)
+assert any(_summary.locations_profile_report_list)
+for (
+    _reinforcement_profile
+) in ReinforcementProfileBuilderFactory.get_available_reinforcements():
+    assert any(
+        isinstance(
+            _rep_profile.profile_cost_report.reinforced_profile,
+            _reinforcement_profile,
+        )
+        for _rep_profile in _summary.locations_profile_report_list
+    ), f"Profile type {_reinforcement_profile.__name__} not found."
+for _multi_report in _summary.locations_profile_report_list:
+    _mlp_plot = MultiLocationProfileComparisonPlotExporter()
+    _mlp_plot.cost_report = _multi_report
+    _mlp_plot.export_dir = _output_dir
+    _mlp_plot.export()
+
+ +
+
+ +
+
+ +
+ +
+ +
+ + + + « Previous + + + Next » + + +
+ + + + + + + +