Re: [GRASS-dev] gunittest test temporal dataset
Hi again, Looking at my example I see that there is in fact a possibility to check existence of an STDS without t.list. See: https://github.com/NVE/actinia_modules_nve/blob/036a4c85664a9015d5ca13ed6f40bdcc79bbfcb2/src/temporal/t.rast.reclass/t.rast.reclass.py#L294-L316 You could basically do: import grass.temporal as tgis # Initialize TGIS tgis.init() # Connect to TGIS DB dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() output_strds = tgis.factory.dataset_factory("strds", "MY_STRDS_NAME") output_strds_exists = output_strds.is_in_db(dbif) assertTrue(output_strds_exists) Maybe worth considering to add a method for that in the unittest module!?! Cheers, Stefan Gesendet: Montag, 27. März 2023 um 14:15 Uhr Von: "Luca Delucchi" An: "Stefan Blumentrath" Cc: "GRASS-dev" Betreff: Re: [GRASS-dev] gunittest test temporal dataset Il lun 27 mar 2023, 13:21 Stefan Blumentrath mailto:stefan.blumentr...@gmx.de]> ha scritto: Hi Luca, Hi Stefan, Not that I am aware of. I use to parse output from t.list to check if a STDS exists... Yes this was my idea too. Do you have an example? Cheers Stefan Cheers Luca ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] gunittest test temporal dataset
Il lun 27 mar 2023, 13:21 Stefan Blumentrath ha scritto: > Hi Luca, > Hi Stefan, > > Not that I am aware of. I use to parse output from t.list to check if a > STDS exists... > Yes this was my idea too. Do you have an example? > > Cheers > Stefan > > Cheers Luca > ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] gunittest test temporal dataset
Hi Luca, Not that I am aware of. I use to parse output from t.list to check if a STDS exists... Cheers Stefan Gesendet: Montag, 27. März 2023 um 11:31 Uhr Von: "Luca Delucchi" An: "GRASS-dev" Betreff: [GRASS-dev] gunittest test temporal dataset Hi devs, is there a way to test if a temporal dataset exists or not? something like assertRasterExists in the case it doesn't exist it could be useful? -- ciao Luca www.lucadelu.org ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] gunittest test temporal dataset
Hi devs, is there a way to test if a temporal dataset exists or not? something like assertRasterExists in the case it doesn't exist it could be useful? -- ciao Luca www.lucadelu.org ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev