Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 2dd34a4

Browse files
authored
Use pickle in a pandas 2.x compatible way (#35)
Going by pandas-dev/pandas#53300 this should be backwards compatible with older versions of pandas down to 0.20.3.
1 parent 4c22e05 commit 2dd34a4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

astrovascpy/io.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def load_graph_from_bin(filename):
5454
if os.path.exists(filename):
5555
print("Loading graph from binary file using pickle", flush=True)
5656
filehandler = open(filename, "rb")
57-
pv = pickle.load(filehandler)
57+
pv = pd.read_pickle(filehandler)
5858
graph = Graph.from_point_vasculature(pv)
5959
else:
6060
raise BloodFlowError("Graph file not found")

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"mpi4py",
2626
"networkx",
2727
"numpy",
28-
"pandas<2.0.0",
28+
"pandas",
2929
"psutil",
3030
"pyyaml",
3131
"scipy",

tests/test_bloodflow.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def test_total_flow_conservation_in_graph(params):
424424
TEST_DIR = Path(__file__).resolve().parent.parent
425425
graph_path_cc = TEST_DIR / "examples/data/graphs_folder/toy_graph.bin"
426426
filehandler = open(graph_path_cc, "rb")
427-
pv = pickle.load(filehandler)
427+
pv = pd.read_pickle(filehandler)
428428
graph = utils.Graph.from_point_vasculature(pv)
429429

430430
entry_nodes = [123, 144, 499]

0 commit comments

Comments
 (0)