Exemple #1
0
    def test_init_model_kwargs(self):
        locations_kwargs = {1: 1}
        surveys_kwargs = {2: 2}
        points_kwargs = {3: 3}
        gexec = GeomExecutor(
            HoleDirection.H,
            locations_kwargs=locations_kwargs,
            surveys_kwargs=surveys_kwargs,
            points_kwargs=points_kwargs,
        )

        assert gexec.model_kwargs["locations"] == locations_kwargs
        assert gexec.model_kwargs["surveys"] == surveys_kwargs
        assert gexec.model_kwargs["points"] == {
            "batch_size": 1000,
            **points_kwargs
        }
Exemple #2
0
 async def test_process_and_persist_v_small_batch(self, geoms_v, bind):
     geoms = geoms_v[:3]
     geomset = pd.DataFrame.shapes.from_records(geoms, create_index=True)
     gexec = GeomExecutor(HoleDirection.V)
     dataset: WellGeometrySet = await gexec.process(geomset)
     await gexec.persist(dataset)
Exemple #3
0
 async def test_process_and_persist_v_full(self, geomset_v, bind):
     gexec = GeomExecutor(HoleDirection.V)
     dataset: WellGeometrySet = await gexec.process(geomset_v)
     await gexec.persist(dataset)
Exemple #4
0
 async def test_download_catch_network_error(self, hole_dir):
     gexec = GeomExecutor(hole_dir)
     with pytest.raises(Exception):
         await gexec.download(zaza=["a", "b", "c"])
Exemple #5
0
 async def test_download_bad_holedir(self):
     gexec = GeomExecutor(HoleDirection.H)
     gexec.hole_dir = ProdStatRange.FIRST
     with pytest.raises(ValueError):
         await gexec.download(zaza=["a", "b", "c"])
Exemple #6
0
 async def test_download(self, wells_h_dispatcher, hole_dir):
     gexec = GeomExecutor(hole_dir)
     geomset = await gexec.download(api14s=["a", "b", "c"],
                                    dispatch=wells_h_dispatcher)
     assert isinstance(geomset, WellGeometrySet)
     assert gexec.metrics.shape[0] == 1
Exemple #7
0
 def test_init_default(self):
     gexec = GeomExecutor(HoleDirection.H)
     assert gexec.metrics.empty is True
Exemple #8
0
 def gexec(self):
     yield GeomExecutor(HoleDirection.H)
Exemple #9
0
 async def run_geoms(holedir: HoleDirection, api14s: List[str]):
     gexec = GeomExecutor(holedir)
     geomset = await gexec.download(api14s=api14s)
     geomset = await gexec.process(geomset)
     await gexec.persist(geomset)