How to use the ert.enkf.EnkfPrototype function in ert

To help you get started, we’ve selected a few ert examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Ensembles / ert / python / python / ert / enkf / ecl_config.py View on Github external
_get_gridfile           = EnkfPrototype("char* ecl_config_get_gridfile(ecl_config)")
    _set_gridfile           = EnkfPrototype("void  ecl_config_set_grid(ecl_config, char*)")
    _validate_gridfile      = EnkfPrototype("ui_return_obj ecl_config_validate_grid(ecl_config, char*)")
    _get_grid               = EnkfPrototype("ecl_grid_ref ecl_config_get_grid(ecl_config)")
    _get_schedule_file      = EnkfPrototype("char* ecl_config_get_schedule_file(ecl_config)")
    _set_schedule_file      = EnkfPrototype("void  ecl_config_set_schedule_file(ecl_config, char*, char*)")
    _validate_schedule_file = EnkfPrototype("ui_return_obj ecl_config_validate_schedule_file(ecl_config, char*)")
    _get_sched_file         = EnkfPrototype("sched_file_ref ecl_config_get_sched_file(ecl_config)")
    _get_init_section       = EnkfPrototype("char* ecl_config_get_init_section(ecl_config)")
    _set_init_section       = EnkfPrototype("void  ecl_config_set_init_section(ecl_config, char*)")
    _validate_init_section  = EnkfPrototype("ui_return_obj ecl_config_validate_init_section(ecl_config, char*)")
    _get_refcase_name       = EnkfPrototype("char* ecl_config_get_refcase_name(ecl_config)")
    _get_refcase            = EnkfPrototype("ecl_sum_ref ecl_config_get_refcase(ecl_config)")
    _load_refcase           = EnkfPrototype("void  ecl_config_load_refcase(ecl_config, char*)")
    _validate_refcase       = EnkfPrototype("ui_return_obj ecl_config_validate_refcase(ecl_config, char*)")
    _has_refcase            = EnkfPrototype("bool  ecl_config_has_refcase(ecl_config)")
    _get_static_kw_list     = EnkfPrototype("stringlist_ref ecl_config_get_static_kw_list(ecl_config)")
    _clear_static_kw        = EnkfPrototype("void  ecl_config_clear_static_kw(ecl_config)")
    _add_static_kw          = EnkfPrototype("void  ecl_config_add_static_kw(ecl_config, char*)")
    _get_depth_unit         = EnkfPrototype("char* ecl_config_get_depth_unit(ecl_config)")
    _get_pressure_unit      = EnkfPrototype("char* ecl_config_get_pressure_unit(ecl_config)")

    def __init__(self):
        c_ptr = self._alloc()
        if c_ptr:
            super(EclConfig, self).__init__(c_ptr)
        else:
            raise RuntimeError('Internal error: Failed constructing EclConfig!')

    def free(self):
        self._free()
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / enkf / site_config.py View on Github external
_get_rsh_command       = EnkfPrototype("char* site_config_get_rsh_command(site_config)")
    _set_rsh_command       = EnkfPrototype("void site_config_set_rsh_command(site_config, char*)")
    _get_max_running_rsh   = EnkfPrototype("int site_config_get_max_running_rsh(site_config)")
    _set_max_running_rsh   = EnkfPrototype("void site_config_set_max_running_rsh(site_config, int)")
    _get_rsh_host_list     = EnkfPrototype("integer_hash_ref site_config_get_rsh_host_list(site_config)")
    _clear_rsh_host_list   = EnkfPrototype("void site_config_clear_rsh_host_list(site_config)")
    _add_rsh_host          = EnkfPrototype("void site_config_add_rsh_host(site_config, char*, int)")
    _get_max_running_local = EnkfPrototype("int site_config_get_max_running_local(site_config)")
    _set_max_running_local = EnkfPrototype("void site_config_set_max_running_local(site_config, int)")
    _get_installed_jobs    = EnkfPrototype("ext_joblist_ref site_config_get_installed_jobs(site_config)")
    _get_max_submit        = EnkfPrototype("int site_config_get_max_submit(site_config)")
    _set_max_submit        = EnkfPrototype("void site_config_set_max_submit(site_config, int)")
    _get_license_root_path = EnkfPrototype("char* site_config_get_license_root_path(site_config)")
    _set_license_root_path = EnkfPrototype("void site_config_set_license_root_path(site_config, char*)")
    _get_job_script        = EnkfPrototype("char* site_config_get_job_script(site_config)")
    _set_job_script        = EnkfPrototype("void site_config_set_job_script(site_config, char*)")
    _get_env_hash          = EnkfPrototype("string_hash_ref site_config_get_env_hash(site_config)")
    _clear_env             = EnkfPrototype("void site_config_clear_env(site_config)")
    _setenv                = EnkfPrototype("void site_config_setenv(site_config, char*, char*)")
    _get_path_variables    = EnkfPrototype("stringlist_ref site_config_get_path_variables(site_config)")
    _get_path_values       = EnkfPrototype("stringlist_ref site_config_get_path_values(site_config)")
    _clear_pathvar         = EnkfPrototype("void site_config_clear_pathvar(site_config)")
    _update_pathvar        = EnkfPrototype("void site_config_update_pathvar(site_config, char*, char*)")
    _get_job_queue         = EnkfPrototype("job_queue_ref site_config_get_job_queue(site_config)")
    _queue_is_running      = EnkfPrototype("bool site_config_queue_is_running(site_config)")
    _get_location          = EnkfPrototype("char* site_config_get_location(site_config)")
    _has_driver            = EnkfPrototype("bool site_config_has_queue_driver(site_config, char*)")


    
    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly!")
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / enkf / enkf_main.py View on Github external
_get_local_config = EnkfPrototype("local_config_ref enkf_main_get_local_config( enkf_main )")
    _get_analysis_config = EnkfPrototype("analysis_config_ref enkf_main_get_analysis_config( enkf_main)")
    _get_site_config = EnkfPrototype("site_config_ref enkf_main_get_site_config( enkf_main)")
    _get_ecl_config = EnkfPrototype("ecl_config_ref enkf_main_get_ecl_config( enkf_main)")
    _get_plot_config = EnkfPrototype("plot_settings_ref enkf_main_get_plot_config( enkf_main)")
    _set_eclbase = EnkfPrototype("ui_return_obj enkf_main_set_eclbase( enkf_main, char*)")
    _set_datafile = EnkfPrototype("void enkf_main_set_data_file( enkf_main, char*)")
    _get_schedule_prediction_file = EnkfPrototype("char* enkf_main_get_schedule_prediction_file( enkf_main )")
    _set_schedule_prediction_file = EnkfPrototype("void enkf_main_set_schedule_prediction_file( enkf_main , char*)")
    _get_data_kw = EnkfPrototype("subst_list_ref enkf_main_get_data_kw(enkf_main)")
    _clear_data_kw = EnkfPrototype("void enkf_main_clear_data_kw(enkf_main)")
    _add_data_kw = EnkfPrototype("void enkf_main_add_data_kw(enkf_main, char*, char*)")
    _resize_ensemble = EnkfPrototype("void enkf_main_resize_ensemble(enkf_main, int)")
    _del_node = EnkfPrototype("void enkf_main_del_node(enkf_main, char*)")
    _get_obs = EnkfPrototype("enkf_obs_ref enkf_main_get_obs(enkf_main)")
    _load_obs = EnkfPrototype("void enkf_main_load_obs(enkf_main, char* , bool)")
    _get_pre_clear_runpath = EnkfPrototype("bool enkf_main_get_pre_clear_runpath(enkf_main)")
    _set_pre_clear_runpath = EnkfPrototype("void enkf_main_set_pre_clear_runpath(enkf_main, bool)")
    _iget_keep_runpath = EnkfPrototype("int enkf_main_iget_keep_runpath(enkf_main, int)")
    _iset_keep_runpath = EnkfPrototype("void enkf_main_iset_keep_runpath(enkf_main, int, int_vector)")
    _get_templates = EnkfPrototype("ert_templates_ref enkf_main_get_templates(enkf_main)")
    _get_site_config_file = EnkfPrototype("char* enkf_main_get_site_config_file(enkf_main)")
    _get_history_length = EnkfPrototype("int enkf_main_get_history_length(enkf_main)")
    _get_observations = EnkfPrototype("void enkf_main_get_observations(enkf_main, char*, int, long*, double*, double*)")
    _get_observation_count = EnkfPrototype("int enkf_main_get_observation_count(enkf_main, char*)")
    _iget_state = EnkfPrototype("enkf_state_ref enkf_main_iget_state(enkf_main, int)")
    _get_workflow_list = EnkfPrototype("ert_workflow_list_ref enkf_main_get_workflow_list(enkf_main)")
    _get_hook_manager = EnkfPrototype("hook_manager_ref enkf_main_get_hook_manager(enkf_main)")
    _get_user_config_file = EnkfPrototype("char* enkf_main_get_user_config_file(enkf_main)")
    _get_mount_point = EnkfPrototype("char* enkf_main_get_mount_root( enkf_main )")
    _export_field = EnkfPrototype("bool enkf_main_export_field(enkf_main, char*, char*, bool_vector, enkf_field_file_format_enum, int)")
    _export_field_with_fs = EnkfPrototype("bool enkf_main_export_field_with_fs(enkf_main, char*, char*, bool_vector, enkf_field_file_format_enum, int, enkf_fs_manager)")
github Ensembles / ert / python / python / ert / enkf / plot_data / pca_plot_data.py View on Github external
from cwrap import BaseCClass

from ert.enkf import EnkfPrototype
from ert.util import Matrix
from ert.enkf.plot_data import PcaPlotVector


class PcaPlotData(BaseCClass):
    TYPE_NAME = "pca_plot_data"

    _alloc               = EnkfPrototype("void* pca_plot_data_alloc(char*, matrix, matrix , double_vector)", bind = False)
    _component_count     = EnkfPrototype("int   pca_plot_data_get_size(pca_plot_data)")
    _realization_count   = EnkfPrototype("int   pca_plot_data_get_ens_size(pca_plot_data)")
    _get                 = EnkfPrototype("pca_plot_vector_ref pca_plot_data_iget_vector(pca_plot_data, int)")
    _get_name            = EnkfPrototype("char* pca_plot_data_get_name(pca_plot_data)")
    _get_singular_values = EnkfPrototype("double_vector_ref pca_plot_data_get_singular_values(pca_plot_data)")
    _free                = EnkfPrototype("void  pca_plot_data_free(pca_plot_data)")

    def __init__(self, name, principal_component_matrix, observation_principal_component_matrix, singular_values):
        assert isinstance(name, str)
        assert isinstance(principal_component_matrix, Matrix)
        assert isinstance(observation_principal_component_matrix, Matrix)

        c_pointer = self._alloc(name, principal_component_matrix, observation_principal_component_matrix , singular_values)
        super(PcaPlotData, self).__init__(c_pointer)

    def componentCount(self):
        return len(self)
    def realizationCount(self):
        return self._realization_count()
    def name(self):
        return self._get_name()
github Ensembles / ert / devel / python / python / ert / enkf / enkf_fs_manager.py View on Github external
# For normal use from ert all filesystems will be located in the same
# folder in the filesystem - corresponding to the ENSPATH setting in
# the config file; in this implementation that setting is stored in
# the @mount_root field. Currently @mount_root is fixed to the value
# returned by EnKFMain.getMountPoint(), but in principle a different
# path could be sent as the the optional second argument to the
# getFS() method. 

class EnkfFsManager(BaseCClass):
    TYPE_NAME = "enkf_fs_manager"

    _get_current_fs = EnkfPrototype("enkf_fs_ref enkf_main_get_fs_ref(enkf_fs_manager)")
    _switch_fs =      EnkfPrototype("void enkf_main_set_fs(enkf_fs_manager, enkf_fs, char*)")
    _fs_exists =      EnkfPrototype("bool enkf_main_fs_exists(enkf_fs_manager, char*)")
    _alloc_caselist = EnkfPrototype("stringlist_obj enkf_main_alloc_caselist(enkf_fs_manager)")
    _set_case_table = EnkfPrototype("void enkf_main_set_case_table(enkf_fs_manager, char*)")

    _is_initialized =                        EnkfPrototype("bool enkf_main_is_initialized(enkf_fs_manager, bool_vector)")
    _is_case_initialized =                   EnkfPrototype("bool enkf_main_case_is_initialized(enkf_fs_manager, char*, bool_vector)")
    _initialize_from_scratch =               EnkfPrototype("void enkf_main_initialize_from_scratch(enkf_fs_manager, enkf_fs , stringlist, int, int, bool)")
    _initialize_case_from_existing =         EnkfPrototype("void enkf_main_init_case_from_existing(enkf_fs_manager, enkf_fs, int, enkf_fs)")
    _custom_initialize_from_existing =       EnkfPrototype("void enkf_main_init_current_case_from_existing_custom(enkf_fs_manager, enkf_fs, int, stringlist, bool_vector)")
    _initialize_current_case_from_existing = EnkfPrototype("void enkf_main_init_current_case_from_existing(enkf_fs_manager, enkf_fs, int)")

    _alloc_readonly_state_map = EnkfPrototype("state_map_obj enkf_main_alloc_readonly_state_map(enkf_fs_manager, char*)")
    _alloc_readonly_time_map =  EnkfPrototype("time_map_obj enkf_main_alloc_readonly_time_map(enkf_fs_manager, char*)")

    DEFAULT_CAPACITY = 5

    def __init__(self, enkf_main, capacity=DEFAULT_CAPACITY):
        """
github Ensembles / ert / devel / python / python / ert / enkf / enkf_fs_manager.py View on Github external
_get_current_fs = EnkfPrototype("enkf_fs_ref enkf_main_get_fs_ref(enkf_fs_manager)")
    _switch_fs =      EnkfPrototype("void enkf_main_set_fs(enkf_fs_manager, enkf_fs, char*)")
    _fs_exists =      EnkfPrototype("bool enkf_main_fs_exists(enkf_fs_manager, char*)")
    _alloc_caselist = EnkfPrototype("stringlist_obj enkf_main_alloc_caselist(enkf_fs_manager)")
    _set_case_table = EnkfPrototype("void enkf_main_set_case_table(enkf_fs_manager, char*)")

    _is_initialized =                        EnkfPrototype("bool enkf_main_is_initialized(enkf_fs_manager, bool_vector)")
    _is_case_initialized =                   EnkfPrototype("bool enkf_main_case_is_initialized(enkf_fs_manager, char*, bool_vector)")
    _initialize_from_scratch =               EnkfPrototype("void enkf_main_initialize_from_scratch(enkf_fs_manager, enkf_fs , stringlist, int, int, bool)")
    _initialize_case_from_existing =         EnkfPrototype("void enkf_main_init_case_from_existing(enkf_fs_manager, enkf_fs, int, enkf_fs)")
    _custom_initialize_from_existing =       EnkfPrototype("void enkf_main_init_current_case_from_existing_custom(enkf_fs_manager, enkf_fs, int, stringlist, bool_vector)")
    _initialize_current_case_from_existing = EnkfPrototype("void enkf_main_init_current_case_from_existing(enkf_fs_manager, enkf_fs, int)")

    _alloc_readonly_state_map = EnkfPrototype("state_map_obj enkf_main_alloc_readonly_state_map(enkf_fs_manager, char*)")
    _alloc_readonly_time_map =  EnkfPrototype("time_map_obj enkf_main_alloc_readonly_time_map(enkf_fs_manager, char*)")

    DEFAULT_CAPACITY = 5

    def __init__(self, enkf_main, capacity=DEFAULT_CAPACITY):
        """
        @type enkf_main: ert.enkf.EnKFMain 
        @type capacity: int
        """
        super(EnkfFsManager, self).__init__(enkf_main.from_param(enkf_main).value, parent=enkf_main, is_reference=True)

        self._fs_rotator = FileSystemRotator(capacity)
        self._mount_root = enkf_main.getMountPoint()

        self._fs_type = enkf_main.getModelConfig().getFSType()
        self._fs_arg = None
github Ensembles / ert / python / python / ert / enkf / enkf_main.py View on Github external
_create_new_config = EnkfPrototype("void enkf_main_create_new_config(char* , char*, char* , int)", bind = False)

    _free = EnkfPrototype("void enkf_main_free(enkf_main)")
    _get_ensemble_size = EnkfPrototype("int enkf_main_get_ensemble_size( enkf_main )")
    _get_ens_config = EnkfPrototype("ens_config_ref enkf_main_get_ensemble_config( enkf_main )")
    _get_model_config = EnkfPrototype("model_config_ref enkf_main_get_model_config( enkf_main )")
    _get_local_config = EnkfPrototype("local_config_ref enkf_main_get_local_config( enkf_main )")
    _get_analysis_config = EnkfPrototype("analysis_config_ref enkf_main_get_analysis_config( enkf_main)")
    _get_site_config = EnkfPrototype("site_config_ref enkf_main_get_site_config( enkf_main)")
    _get_ecl_config = EnkfPrototype("ecl_config_ref enkf_main_get_ecl_config( enkf_main)")
    _get_plot_config = EnkfPrototype("plot_settings_ref enkf_main_get_plot_config( enkf_main)")
    _set_eclbase = EnkfPrototype("ui_return_obj enkf_main_set_eclbase( enkf_main, char*)")
    _set_datafile = EnkfPrototype("void enkf_main_set_data_file( enkf_main, char*)")
    _get_schedule_prediction_file = EnkfPrototype("char* enkf_main_get_schedule_prediction_file( enkf_main )")
    _set_schedule_prediction_file = EnkfPrototype("void enkf_main_set_schedule_prediction_file( enkf_main , char*)")
    _get_data_kw = EnkfPrototype("subst_list_ref enkf_main_get_data_kw(enkf_main)")
    _clear_data_kw = EnkfPrototype("void enkf_main_clear_data_kw(enkf_main)")
    _add_data_kw = EnkfPrototype("void enkf_main_add_data_kw(enkf_main, char*, char*)")
    _resize_ensemble = EnkfPrototype("void enkf_main_resize_ensemble(enkf_main, int)")
    _del_node = EnkfPrototype("void enkf_main_del_node(enkf_main, char*)")
    _get_obs = EnkfPrototype("enkf_obs_ref enkf_main_get_obs(enkf_main)")
    _load_obs = EnkfPrototype("void enkf_main_load_obs(enkf_main, char* , bool)")
    _get_pre_clear_runpath = EnkfPrototype("bool enkf_main_get_pre_clear_runpath(enkf_main)")
    _set_pre_clear_runpath = EnkfPrototype("void enkf_main_set_pre_clear_runpath(enkf_main, bool)")
    _iget_keep_runpath = EnkfPrototype("int enkf_main_iget_keep_runpath(enkf_main, int)")
    _iset_keep_runpath = EnkfPrototype("void enkf_main_iset_keep_runpath(enkf_main, int, int_vector)")
    _get_templates = EnkfPrototype("ert_templates_ref enkf_main_get_templates(enkf_main)")
    _get_site_config_file = EnkfPrototype("char* enkf_main_get_site_config_file(enkf_main)")
    _get_history_length = EnkfPrototype("int enkf_main_get_history_length(enkf_main)")
    _get_observations = EnkfPrototype("void enkf_main_get_observations(enkf_main, char*, int, long*, double*, double*)")
    _get_observation_count = EnkfPrototype("int enkf_main_get_observation_count(enkf_main, char*)")
    _iget_state = EnkfPrototype("enkf_state_ref enkf_main_iget_state(enkf_main, int)")
github Ensembles / ert / python / python / ert / enkf / ert_workflow_list.py View on Github external
from cwrap import BaseCClass
from ert.enkf import EnkfPrototype
from ert.util import StringList, SubstitutionList
from ert.job_queue import Workflow, WorkflowJob


class ErtWorkflowList(BaseCClass):
    TYPE_NAME = "ert_workflow_list"

    _alloc_namelist = EnkfPrototype("stringlist_obj ert_workflow_list_alloc_namelist(ert_workflow_list)")
    _has_workflow   = EnkfPrototype("bool ert_workflow_list_has_workflow(ert_workflow_list, char*)")
    _get_workflow   = EnkfPrototype("workflow_ref ert_workflow_list_get_workflow(ert_workflow_list, char*)")
    _get_context    = EnkfPrototype("subst_list_ref ert_workflow_list_get_context(ert_workflow_list)")
    _add_job        = EnkfPrototype("void ert_workflow_list_add_job(ert_workflow_list, char*, char*)")
    _has_job        = EnkfPrototype("bool ert_workflow_list_has_job(ert_workflow_list, char*)")
    _get_job        = EnkfPrototype("workflow_job_ref ert_workflow_list_get_job(ert_workflow_list, char*)")
    _get_job_names  = EnkfPrototype("stringlist_obj ert_workflow_list_get_job_names(ert_workflow_list)")
    _free           = EnkfPrototype("void ert_workflow_list_free(ert_workflow_list)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly!")

    def getWorkflowNames(self):
        """ @rtype: StringList """
        return self._alloc_namelist()

    def __contains__(self, workflow_name):
        assert isinstance(workflow_name, str)
        return self._has_workflow(workflow_name)
github OPM / ResInsight / ThirdParty / Ert / python / python / ert / enkf / observations / obs_vector.py View on Github external
#   
#  See the GNU General Public License at  
#  for more details.
from cwrap import BaseCClass
from ert.enkf import EnkfPrototype
from ert.enkf.config import EnkfConfigNode
from ert.enkf.enums import EnkfObservationImplementationType
from ert.enkf.observations import BlockObservation, SummaryObservation, GenObservation


class ObsVector(BaseCClass):
    TYPE_NAME = "obs_vector"

    _alloc                = EnkfPrototype("void* obs_vector_alloc(enkf_obs_impl_type, char*, enkf_config_node, int)", bind = False)
    _free                 = EnkfPrototype("void  obs_vector_free( obs_vector )")
    _get_state_kw         = EnkfPrototype("char* obs_vector_get_state_kw( obs_vector )")
    _get_key              = EnkfPrototype("char* obs_vector_get_key( obs_vector )")
    _iget_node            = EnkfPrototype("void* obs_vector_iget_node( obs_vector, int)")
    _get_num_active       = EnkfPrototype("int   obs_vector_get_num_active( obs_vector )")
    _iget_active          = EnkfPrototype("bool  obs_vector_iget_active( obs_vector, int)")
    _get_impl_type        = EnkfPrototype("enkf_obs_impl_type obs_vector_get_impl_type( obs_vector)")
    _install_node         = EnkfPrototype("void  obs_vector_install_node(obs_vector, int, void*)")
    _get_next_active_step = EnkfPrototype("int   obs_vector_get_next_active_step(obs_vector, int)")
    _has_data             = EnkfPrototype("bool  obs_vector_has_data(obs_vector , bool_vector , enkf_fs)")
    _get_config_node      = EnkfPrototype("enkf_config_node_ref obs_vector_get_config_node(obs_vector)")
    _get_total_chi2       = EnkfPrototype("double obs_vector_total_chi2(obs_vector, enkf_fs, int)")
    _get_obs_key          = EnkfPrototype("char*  obs_vector_get_obs_key(obs_vector)")
    _get_step_list        = EnkfPrototype("int_vector_ref obs_vector_get_step_list(obs_vector)")
    _create_local_node    = EnkfPrototype("local_obsdata_node_obj obs_vector_alloc_local_node(obs_vector)")

    def __init__(self, observation_type, observation_key, config_node, num_reports):
        """
github Ensembles / ert / python / python / ert / enkf / hook_workflow.py View on Github external
import os
import sys
from cwrap import BaseCClass
from ert.enkf import EnkfPrototype, RunpathList

class HookWorkflow(BaseCClass):
    TYPE_NAME = "hook_workflow"

    _get_workflow = EnkfPrototype("workflow_ref hook_workflow_get_workflow(hook_workflow)")
    _get_runmode  = EnkfPrototype("hook_runtime_enum hook_workflow_get_run_mode(hook_workflow)")

    def __init__(self):
        raise NotImplementedError("Class can not be instantiated directly!")

    def getWorkflow(self):
        """ @rtype: Workflow """
        return self._get_workflow()

    def getRunMode(self):
        return self._get_runmode()