ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

load_script linting results in error #4997

Open Tom-Willemsen opened 4 years ago

Tom-Willemsen commented 4 years ago

On NDXDEMO, loading any user script via g.load_script() throws the following error:

Traceback (most recent call last):
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie.py", line 1283, in load_script
    errs = sc.check_script(full_name, instrument_full_name, warnings_as_error=warnings_as_error)
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie_script_checker.py", line 91, in check_script
    functions = self.get_inst_attributes(inst_scripts_file_path)
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie_script_checker.py", line 145, in get_inst_attributes
    attributes += self.get_all_attributes(tree)
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie_script_checker.py", line 158, in get_all_attributes
    attributes = self.get_names_of_functions_classes_global_variables(tree.body)
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie_script_checker.py", line 176, in get_names_of_functions_classes_global_variables
    attributes += self.get_class_member_names(item.body, class_name)
  File "C:\Instrument\Apps\Python\lib\site-packages\genie_python\genie_script_checker.py", line 195, in get_class_member_names
    for variables in function_body.body:
AttributeError: 'Expr' object has no attribute 'body'

Acceptance criteria:

JamesKingWork commented 4 years ago

When I pulled the same scripts onto my machine the linter worked correctly. This may be due to a deployment issue or something unexpected by the linter in the demo environment.

kjwoodsISIS commented 4 years ago

This is precisely why it is a good idea to demo new features in the Sprint Review. It shows up these types of deployment issue at an early stage - before the users encounter the problem.

JamesKingWork commented 4 years ago

This is precisely why it is a good idea to demo new features in the Sprint Review. It shows up these types of deployment issue at an early stage - before the users encounter the problem.

Couldn't agree more, I'm organising to encourage more demoing after that was raised at retrospective