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" <lucadel...@gmail.com>
An: "Stefan Blumentrath" <stefan.blumentr...@gmx.de>
Cc: "GRASS-dev" <grass-dev@lists.osgeo.org>
Betreff: Re: [GRASS-dev] gunittest test temporal dataset

 

Il lun 27 mar 2023, 13:21 Stefan Blumentrath 
<stefan.blumentr...@gmx.de[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

Reply via email to