MCPcopy Create free account
hub / github.com/MarcCoru/locationencoder / find_matrix_plot_filename

Function find_matrix_plot_filename

utils/plot_results.py:210–223  ·  view source on GitHub ↗
(resultsdir, pe, nn)

Source from the content-addressed store, hash-verified

208 return fig
209
210def find_matrix_plot_filename(resultsdir, pe, nn):
211 candidates = os.listdir(resultsdir)
212 candidates = [f for f in candidates if (f"{pe:1.8}-{nn:1.6}" in f)]
213 candidates = [f for f in candidates if ("globe" not in f)]
214 candidates = [f for f in candidates if f.endswith('.png')]
215
216 if len(candidates) > 1:
217 print('found multiple pngs that fit the criteria for plotting:')
218 print(candidates)
219 elif len(candidates) == 0:
220 print(f'could not find a png that fits the crieteria for plotting', end='')
221 print(f' for {pe}, {nn} in {resultsdir}')
222 return
223 return candidates[0]
224
225
226def plot_result_matrix(resultsdir, positional_encoders, neural_networks, show=False, savepath=None):

Callers 1

plot_result_matrixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected