Skip to content

Commit

Permalink
reup linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jGaboardi committed Oct 3, 2023
1 parent d9a8fc0 commit ea197e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spaghetti/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1742,7 +1742,7 @@ def allneighbordistances(
self.full_distance_matrix(n_processes, gen_tree=gen_tree)

# set the source and destination observation point patterns
if type(sourcepattern) is str:
if isinstance(sourcepattern, str):
sourcepattern = self.pointpatterns[sourcepattern]
if destpattern:
destpattern = self.pointpatterns[destpattern]
Expand All @@ -1768,7 +1768,7 @@ def allneighbordistances(
symmetric = True
destpattern = sourcepattern
# set local copy of destination pattern index
dest_indices = list(destpattern.points.keys())
dest_indices = list(destpattern.points)
# set local copy of destination distance to vertex lookup
dst_d2v = copy.deepcopy(destpattern.dist_to_vertex)
# destination point count
Expand Down Expand Up @@ -2003,7 +2003,7 @@ def nearestneighbordistances(
"""

# raise exception is the specified point pattern does not exist
if sourcepattern not in self.pointpatterns.keys():
if sourcepattern not in self.pointpatterns:
raise KeyError(f"Available point patterns are {self.pointpatterns.keys()}")

# calculate the network vertex to vertex distance matrix
Expand Down Expand Up @@ -2282,7 +2282,7 @@ def int_coord(c):
"""convert coordinates for integers if possible
e.g., (1.0, 0.5) --> (1, 0.5)
"""
return int(c) if (type(c) == float and c.is_integer()) else c
return int(c) if (isinstance(c, float) and c.is_integer()) else c

# catch invalid split types
_split_by = split_by.lower()
Expand Down Expand Up @@ -2395,7 +2395,7 @@ def int_coord(c):
new_vertex = (int_coord(newx), int_coord(newy))

# update the vertex and coordinate info if needed
if new_vertex not in split_network.vertices.keys():
if new_vertex not in split_network.vertices:
split_network.vertices[new_vertex] = currentstop
split_network.vertex_coords[currentstop] = new_vertex
split_network.vertex_list.append(currentstop)
Expand Down

0 comments on commit ea197e4

Please sign in to comment.