FREVA-CLINT / freva

The Free Evaluation System Framework (FreVa)
Other
11 stars 3 forks source link

freva.PluginStatus() does not work for job runs that are not own #234

Open eelucio opened 1 month ago

eelucio commented 1 month ago

If I try to get the pluginstatus information (e.g. output filepaths) of a plugin run that is not mine, I cannot use freva.PluginStatus(), e.g.:

In [50]: hist2 = freva.history(entry_ids=934933,user_name="*")[-1]
[17:50:34] INFO     freva - INFO - history, limit=10, since=None, until=None, entry_ids=[934933]                                                                                                                                                                            _history.py:94

In [51]: hist2
Out[51]: 
{'status_dict': {2: 'broken',
  0: 'finished',
  1: 'finished_no_output',
  5: 'not_scheduled',
  3: 'running',
  4: 'scheduled'},
 'id': 934933,
 'timestamp': '2024-10-08T13:43:37',
 'tool': 'precip_return_period_maps',
 'version': '(0, 0, 0)',
 'version_details_id': 3673,
 'configuration': {'from': '2024-05-30',
  'to': '2024-06-02',
  'inc': 1,
  'dlist': '1,2,3,4',
  'stat': 'expected',
  'plot': True,
  'plot_addmax': False,
  'plot_addtitle': True,
  'cache': '/work/bm1159/XCES/xces-work/b382711/evaluation_system/cache/precip_return_period_maps',
  'outputdir': '/work/bm1159/XCES/xces-work/b382711/evaluation_system/output/precip_return_period_maps/20241008_134337'},
 'slurm_output': '/work/bm1159/XCES/xces-work/share/slurm/precip_return_period_maps/Precip_Return_Period_Maps-2216969.local',
 'host': 'levante2',
 'uid_id': 'b382711',
 'status': 0,
 'flag': 0,
 'caption': '',
 'result': {}}

In [52]: res = freva.PluginStatus(hist2["id"])

In [53]: res
Out[53]: PluginStatus('', config={}, status=unknown)

while with a run I created:


In [46]: hist = freva.history(entry_ids=934069)[-1]
[17:50:06] INFO     freva - INFO - history, limit=10, since=None, until=None, entry_ids=[934069]                                                                                                                                                                            _history.py:94

In [47]: res = freva.PluginStatus(hist["id"])

In [48]: res
Out[48]: PluginStatus('psi', config={'inputdir': None, 'project': 'reanalysis', 'product': 'reanalysis', 'institute': 'ecmwf', 'model': 'ifs', 'experiment': 'era5', 'time_frequency': '1day', 'variable': 'pr', 'ensemble': 'r1i1p1', 'outputdir': '/work/bm1159/XCES/xces-work/event_catalogue/general/psi/bernd/all/hyras/3', 'cache': '/work/bm1159/XCES/xces-work/k204229/evaluation_system/cache/psi', 'cacheclear': False, 'seldate': '2021,2023-12-31', 'selmon': 'all', 'shape_file': None, 'split_by': None, 'region_type': 'countries', 'region': 'germany', 'mask_method': 'corners', 'mask_type': 'none', 'percentile_threshold': True, 'threshold': 80, 'persistence': 3, 'spatial_psi': True, 'spatial_psi_keep': '10', 'sel_extr': None, 'dryrun': False}, status=finished)
antarcticrainforest commented 2 weeks ago

I'll take a look into that.