darabos commited on
Commit
97b3d79
·
1 Parent(s): 6551a1a

Hide joblib-cache, fix decorator ordering.

Browse files
lynxkite-graph-analytics/src/lynxkite_graph_analytics/lynxkite_ops.py CHANGED
@@ -15,7 +15,7 @@ import polars as pl
15
  import json
16
 
17
 
18
- mem = joblib.Memory("joblib-cache")
19
  op = ops.op_registration(core.ENV)
20
 
21
 
@@ -87,8 +87,8 @@ def import_parquet(*, filename: str):
87
  return pd.read_parquet(filename)
88
 
89
 
90
- @mem.cache
91
  @op("Import CSV")
 
92
  def import_csv(
93
  *, filename: str, columns: str = "<from file>", separator: str = "<auto>"
94
  ):
@@ -102,8 +102,8 @@ def import_csv(
102
  )
103
 
104
 
105
- @mem.cache
106
  @op("Import GraphML")
 
107
  def import_graphml(*, filename: str):
108
  """Imports a GraphML file."""
109
  files = fsspec.open_files(filename, compression="infer")
@@ -114,8 +114,8 @@ def import_graphml(*, filename: str):
114
  raise ValueError(f"No .graphml file found at {filename}")
115
 
116
 
117
- @mem.cache
118
  @op("Graph from OSM")
 
119
  def import_osm(*, location: str):
120
  import osmnx as ox
121
 
 
15
  import json
16
 
17
 
18
+ mem = joblib.Memory(".joblib-cache")
19
  op = ops.op_registration(core.ENV)
20
 
21
 
 
87
  return pd.read_parquet(filename)
88
 
89
 
 
90
  @op("Import CSV")
91
+ @mem.cache
92
  def import_csv(
93
  *, filename: str, columns: str = "<from file>", separator: str = "<auto>"
94
  ):
 
102
  )
103
 
104
 
 
105
  @op("Import GraphML")
106
+ @mem.cache
107
  def import_graphml(*, filename: str):
108
  """Imports a GraphML file."""
109
  files = fsspec.open_files(filename, compression="infer")
 
114
  raise ValueError(f"No .graphml file found at {filename}")
115
 
116
 
 
117
  @op("Graph from OSM")
118
+ @mem.cache
119
  def import_osm(*, location: str):
120
  import osmnx as ox
121