コード例 #1
0
    def test_with_enkf_fs(self):
        config_file = self.createTestPath("Statoil/config/with_data/config")

        with TestAreaContext("enkf/summary_key_set/enkf_fs",
                             store_area=True) as context:
            context.copy_parent_content(config_file)

            fs = EnkfFs("storage/default")
            summary_key_set = fs.getSummaryKeySet()
            summary_key_set.addSummaryKey("FOPT")
            summary_key_set.addSummaryKey("WWCT")
            summary_key_set.addSummaryKey("WOPR")
            fs.umount()

            res_config = ResConfig("config")
            ert = EnKFMain(res_config)
            fs = ert.getEnkfFsManager().getCurrentFileSystem()
            summary_key_set = fs.getSummaryKeySet()
            self.assertTrue("FOPT" in summary_key_set)
            self.assertTrue("WWCT" in summary_key_set)
            self.assertTrue("WOPR" in summary_key_set)

            ensemble_config = ert.ensembleConfig()

            self.assertTrue("FOPT" in ensemble_config)
            self.assertTrue("WWCT" in ensemble_config)
            self.assertTrue("WOPR" in ensemble_config)
            self.assertFalse("TCPU" in ensemble_config)
コード例 #2
0
ファイル: enkf_fs_manager.py プロジェクト: oysteoh/ert
    def getFileSystem(self, case_name, mount_root=None) -> EnkfFs:
        """
        @rtype: EnkfFs
        """
        if mount_root is None:
            mount_root = self._mount_root

        full_case_name = self._createFullCaseName(mount_root, case_name)

        if full_case_name not in self._fs_rotator:
            if not EnkfFs.exists(full_case_name):
                if self._fs_rotator.atCapacity():
                    self._fs_rotator.dropOldestFileSystem()

                EnkfFs.createFileSystem(full_case_name)

            new_fs = EnkfFs(full_case_name)
            self._fs_rotator.addFileSystem(new_fs, full_case_name)

        fs = self._fs_rotator[full_case_name]

        return fs