FLO-2DSoftware / FLO-2DMapCrafter

The QGIS FLO-2D MapCrafter plugin repository
0 stars 0 forks source link

Deprecation warnings #77

Closed FLO-2DKaren closed 1 month ago

FLO-2DKaren commented 1 month ago

2024-09-06T10:39:15 WARNING warning:C:\OSGeo4W\apps\Python312\Lib\site-packages\swmmio\utils\text.py:265: FutureWarning: The 'delim_whitespace' keyword in pd.read_csv is deprecated and will be removed in a future version. Use sep='\s+' instead options = pd.read_csv(StringIO(ops_string), header=None,

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 713, in check_files
          nodes_list = list(mymodel.nodes.dataframe.index)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\swmmio\elements.py", line 44, in dataframe
          return self.__call__()
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\swmmio\elements.py", line 85, in __call__
          headers = get_inp_sections_details(self.inp.path)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\swmmio\utils\text.py", line 265, in get_inp_sections_details
          options = pd.read_csv(StringIO(ops_string), header=None,
          File "C:\Users\Karen\AppData\Roaming\Python\Python312\site-packages\pandas\io\parsers\readers.py", line 988, in read_csv
          warnings.warn(
FLO-2DKaren commented 1 month ago

2024-09-06T10:39:23 WARNING warning:C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\scripts.py:252: DeprecationWarning: QgsRasterInterface.bandStatistics() is deprecated stats = provider.bandStatistics(1, QgsRasterBandStats.All, extent, 0)

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 815, in run_map_creator
          flood_maps.create_maps(
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\flood.py", line 147, in create_maps
          self.process_maps(name, raster, file, crs, sc_group, 6)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\flood.py", line 304, in process_maps
          set_raster_style(raster_processed, style)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\scripts.py", line 252, in set_raster_style
          stats = provider.bandStatistics(1, QgsRasterBandStats.All, extent, 0)
FLO-2DKaren commented 1 month ago

2024-09-06T10:39:25 WARNING warning:C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\flood.py:336: DeprecationWarning: QgsField constructor is deprecated pr.addAttributes([QgsField('ID', QVariant.Int), QgsField('Velocity', QVariant.Double), QgsField('Direction', QVariant.Int)])

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 815, in run_map_creator
          flood_maps.create_maps(
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\flood.py", line 274, in create_maps
          self.process_vectors(name, vector, value_file, direction_file, crs, bv_group, self.max_vector_scale)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\flood.py", line 336, in process_vectors
          pr.addAttributes([QgsField('ID', QVariant.Int), QgsField('Velocity', QVariant.Double), QgsField('Direction', QVariant.Int)])
FLO-2DKaren commented 1 month ago

2024-09-06T10:55:52 WARNING warning:C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py:141: FutureWarning: '+init=:' syntax is deprecated. ':' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6 in_crs_string = _prepare_from_proj_string(in_crs_string)

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 1038, in run_map_creator
          storm_drain_plots.plot_graphics(storm_drain_rbs, flo2d_results_dir, sd_output_dir, self.crs.authid(), mapping_group)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\storm_drain.py", line 505, in plot_graphics
          gdf = gpd.GeoDataFrame(nodes_to_shapefile, crs=crs, geometry=geometry)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\geodataframe.py", line 209, in __init__
          self.set_geometry(geometry, inplace=True, crs=crs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\geodataframe.py", line 404, in set_geometry
          level = _ensure_geometry(level, crs=crs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\geodataframe.py", line 66, in _ensure_geometry
          out = from_shapely(data, crs=crs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\array.py", line 184, in from_shapely
          return GeometryArray(arr, crs=crs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\array.py", line 334, in __init__
          self.crs = crs
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\array.py", line 387, in crs
          self._crs = None if not value else CRS.from_user_input(value)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 501, in from_user_input
          return cls(value, **kwargs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 331, in __init__
          projstring = _prepare_from_dict(projparams)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 84, in _prepare_from_dict
          return _prepare_from_string(" ".join(pjargs))
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 141, in _prepare_from_string
          in_crs_string = _prepare_from_proj_string(in_crs_string)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyproj\crs\crs.py", line 113, in _prepare_from_proj_string
          warnings.warn(
FLO-2DKaren commented 1 month ago

2024-09-06T10:55:52 WARNING warning:C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\storm_drain.py:509: UserWarning: Column names longer than 10 characters will be truncated when saved to ESRI Shapefile. gdf.to_file(output_shapefile, driver='ESRI Shapefile')

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 1038, in run_map_creator
          storm_drain_plots.plot_graphics(storm_drain_rbs, flo2d_results_dir, sd_output_dir, self.crs.authid(), mapping_group)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\storm_drain.py", line 509, in plot_graphics
          gdf.to_file(output_shapefile, driver='ESRI Shapefile')
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\geodataframe.py", line 1536, in to_file
          _to_file(self, filename, driver, schema, index, **kwargs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\io\file.py", line 666, in _to_file
          warnings.warn(
FLO-2DKaren commented 1 month ago

2024-09-06T10:55:52 WARNING warning:C:\OSGeo4W\apps\Python312\Lib\site-packages\pyogrio\raw.py:709: RuntimeWarning: Normalized/laundered field name: 'SurchargeDepth' to 'SurchargeD' ogr_write(

         traceback: File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\flo2d_mapcrafter.py", line 1038, in run_map_creator
          storm_drain_plots.plot_graphics(storm_drain_rbs, flo2d_results_dir, sd_output_dir, self.crs.authid(), mapping_group)
          File "C:\Users/Karen/AppData/Roaming/QGIS/QGIS3\profiles\MapCrafter/python/plugins\flo2d_mapcrafter\mapping\storm_drain.py", line 509, in plot_graphics
          gdf.to_file(output_shapefile, driver='ESRI Shapefile')
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\geodataframe.py", line 1536, in to_file
          _to_file(self, filename, driver, schema, index, **kwargs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\io\file.py", line 686, in _to_file
          _to_file_pyogrio(df, filename, driver, schema, crs, mode, metadata, **kwargs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\geopandas\io\file.py", line 748, in _to_file_pyogrio
          pyogrio.write_dataframe(df, filename, driver=driver, metadata=metadata, **kwargs)
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyogrio\geopandas.py", line 654, in write_dataframe
          write(
          File "C:\OSGeo4W\apps\Python312\Lib\site-packages\pyogrio\raw.py", line 709, in write
          ogr_write(
FLO-2DKaren commented 1 month ago

2024-09-06T10:38:28 CRITICAL Problem with GRASS installation: GRASS was not found or is not correctly installed 2024-09-06T10:42:38 INFO Results: {'OUTPUT': 'C:\Users\Public\Documents\FLO-2D PRO Documentation\Example Projects\Self Help Kit Gila\SD from INP\Quick Run\MapCrafter\ARR_FLOOD_HAZARD.tif'} 2024-09-06T11:00:48 CRITICAL Problem with GRASS installation: GRASS was not found or is not correctly installed 2024-09-06T11:00:49 CRITICAL Problem with GRASS installation: GRASS was not found or is not correctly installed

rpachaly commented 1 month ago
rpachaly commented 1 month ago

The QgsRasterInterface.bandStatistics() deprecation is being a pain in the neck. I'll solve this one later. The rest is solved on https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/tree/deprecation-warning

FLO-2DKaren commented 1 month ago

I'm so glad you said that about the bandStatistics!!! I couldn't figure it out.

rpachaly commented 1 month ago

I spent the whole Friday afternoon and some hours this morning and I also couldn't figure out. I'll try a totally different approach, but I'll work on the other issues first.

FLO-2DKaren commented 1 month ago

I thought it would be super easy!!! Maybe it's a bug. You might check with QGIS Repo.

FLO-2DKaren commented 1 month ago

Ooooh maybe GDAL has Band Stats.

rpachaly commented 1 month ago

All fixed and merged on https://github.com/FLO-2DSoftware/FLO-2DMapCrafter/pull/83

FLO-2DKaren commented 1 month ago

Only deprecation warnings are from swmmio