-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace all does not work #20902
Comments
Hi @N0DuckingWay thank you for the feedback! I was unable to reproduce this (although I checked on Windows) Did you had any specific code or there is some example file that you could share with us that could help us reproduce this locally? Could it be possible to screen record (create a GIF with LICEcap for example) the way the error is triggering for you to better understand how to trigger it? Any other info in order to reproduce this is greatly appreciated! Let us know! |
Here is the code that I was using, but in my experience it isn’t specific to any one file or set of code. All I have to do is open up the “find and replace” dialogue at the bottom, enter my desired values, then click the replace all button.
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import fiona as fi, pandas as pd
from shapely.geometry import (Point, shape) # shape() is a function to convert geo objects through the interface
min_distance = 30 # distance (in metres) where point is considered "on" a road
points_to_check = ((-120.2254,39.1920),(-120.2414,39.1889),(-149.1046,60.9594),(-149.0986,60.9582),(-120.22933,39.16043),
(-120.24767,39.15232),) # example coordinates
traits = []
def getvals(coords):
out = []
for c in coords:
if type(c) == list:
out.extend(getvals(c))
else:
out.append(c)
return out
with fi.open(r'C:\Users\zdhoffman\Documents\Apps\Ski App\Data\Input\features_skiareasonly.shp\multipolygons.shp') as shp:
for rec in shp:
boundary = shape(rec['geometry'])
if 'osm_way_id' in dict(rec['properties']).keys():
osm_way_id = rec['properties']['osm_way_id']
else:
osm_way_id = 0
natural = rec['properties']['natural']
landuse = rec['properties']['landuse']
#
contains =boundary.contains([Point(x) for x in points_to_check])
points = [points_to_check[i] for i in range(len(points_to_check)) if contains[i]]
if True in contains:
traits.extend([x for x in [natural,landuse] if x != None])
traits = pd.Series(traits).value_counts()
print(traits)
… On May 6, 2023, at 4:34 PM, Daniel Althviz Moré ***@***.***> wrote:
Hi @N0DuckingWay <https://github.com/N0DuckingWay> thank you for the feedback! I was unable to reproduce this (although I checked on Windows) Did you had any specific code or there is some example file that you could share with us that could help us reproduce this locally? Could it be possible to screen record (create a GIF with LICEcap for example) the way the error is triggering for you to better understand how to trigger it?
Any other info in order to reproduce this is greatly appreciated! Let us know!
—
Reply to this email directly, view it on GitHub <#20902 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AK7W5ZCF76LY2E5S6T4I45LXE3NXXANCNFSM6AAAAAAXXYFVUM>.
You are receiving this because you were mentioned.
|
Thank you for the code example @N0DuckingWay ! Indeed, I tried also the find replace functionality locally with the code provided but I'm still not able to reproduce the error. Could it be possible to also share here the values and options you are using in the find replace widget? Maybe you are using the Any other info in order to better understand this is greatly appreciated. Let us know! |
Closing this since seems like a duplicate of #21007 A fix for the issue will be part of Spyder 5.5.0 |
Description
What steps will reproduce the problem?
Simply clicking the replace all button causes spyder to have an error and exit out of the file.
Traceback
Versions
Dependencies
The text was updated successfully, but these errors were encountered: