Updating the region_id constraint in the single schema would only allow for custom region names when creating a model run. Other portions of the code utilize the region_id constraint.
The DAG support is relatively new and may not be used in the future, but I figured I should update it.
The SiteSummaryFeature is used during the creation of a region from a geoJSON and checks inside of it the region_id. This constraint also needs to be relaxed.
The SiteFeature was a base tool for importing sites and observations in the system. Allowing it to have a custom name means that all geoJSON files can now have unconstrained names as well. (They are limited to the siteID being a name followed by an underscore and 4 or 8 digits.
We returned back the siteid number before using a slice of the text based on knowing how long it is. The updated constraint means that the last split of the `` should be a number that has the site number.
I did this quickly so there may be some more things we would want to enforce.
Below I've attached a quick Command Line python script that can take a folder (like a proposal or ground truth set) and convert them all to utilizing a custom region name. Just python RegionNameConverter.py {parent folder of geoJSONS} {new region name}. It renames the files and updates the geoJSON properties for region_id and site_id. I did this so I could test importing updated data.
I took a KR_R002 folder ran the converter to switch it to "SampleRegionName" and then imported it into RD-WATCH using: python loadModelRun.py 'SampleRegionName' "./SampleRegionName/**/SampleRegionName*.geojson" --title SampleRegionName --performer_shortcode 'KIT'. Hopefully this helps with finding any additional corner cases.
Updating the region_id constraint in the single schema would only allow for custom region names when creating a model run. Other portions of the code utilize the region_id constraint.
I did this quickly so there may be some more things we would want to enforce.
Below I've attached a quick Command Line python script that can take a folder (like a proposal or ground truth set) and convert them all to utilizing a custom region name. Just
python RegionNameConverter.py {parent folder of geoJSONS} {new region name}
. It renames the files and updates the geoJSON properties forregion_id
andsite_id
. I did this so I could test importing updated data.I took a KR_R002 folder ran the converter to switch it to "SampleRegionName" and then imported it into RD-WATCH using:
python loadModelRun.py 'SampleRegionName' "./SampleRegionName/**/SampleRegionName*.geojson" --title SampleRegionName --performer_shortcode 'KIT'
. Hopefully this helps with finding any additional corner cases.RegionNameConverter.txt