Closed NILICK closed 8 months ago
hello @NILICK , I am surprised by the bug you encountered as this has ran smoothly until now in this configuration.
row
iterates over the rows of df_centroids
which is defined here: https://github.com/ArcticSnow/TopoPyScale/blob/4d1d3b772850ea8af86ed80c138f16d479200b58/TopoPyScale/topoclass.py#L358
Did you modify the name of the columns of df_centroids
somewhere in your code?
Hello @ArcticSnow, I did not any changes in the main codes of the TopoPyScale folder. I installed again TopoPyScale in the new env of the mamba and I got the above error again.
What is mp.toposub.df_centroids.columns
showing in your project?
Somehow, the columns, lat, lon
got changed to latitude, longitude
. Can you identify where it may occur, either in TPS code, or some other processing done?
df_centroids
is created by the function extract_topo_param()
The result of mp.toposub.df_centroids.columns
is:
Index(['x', 'y', 'elevation', 'slope', 'aspect_cos', 'aspect_sin', 'svf',
'spatial_ref', 'aspect', 'point_id', 'longitude', 'latitude',
'hori_azi_-175.0', 'hori_azi_-165.0', 'hori_azi_-155.0',
'hori_azi_-145.0', 'hori_azi_-135.0', 'hori_azi_-125.0',
'hori_azi_-115.0', 'hori_azi_-105.0', 'hori_azi_-95.0',
'hori_azi_-85.0', 'hori_azi_-75.0', 'hori_azi_-65.0', 'hori_azi_-55.0',
'hori_azi_-45.0', 'hori_azi_-35.0', 'hori_azi_-25.0', 'hori_azi_-15.0',
'hori_azi_-5.0', 'hori_azi_5.0', 'hori_azi_15.0', 'hori_azi_25.0',
'hori_azi_35.0', 'hori_azi_45.0', 'hori_azi_55.0', 'hori_azi_65.0',
'hori_azi_75.0', 'hori_azi_85.0', 'hori_azi_95.0', 'hori_azi_105.0',
'hori_azi_115.0', 'hori_azi_125.0', 'hori_azi_135.0', 'hori_azi_145.0',
'hori_azi_155.0', 'hori_azi_165.0', 'hori_azi_175.0'],
dtype='object')
It seems that there is a mistake in lines (141-142) of
topo_scale.py
file:With the current code, I got the below error:
But when I changed lines (141-142) of
topo_scale.py
file to:then It runs without error. Do these lines need to improve as above?