Ticket #8124 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Reflectometry GUI needs Config File

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: major Milestone: Release 3.0
Component: Reflectometry Keywords:
Cc: Blocked By:
Blocking: #8125, #8132, #8137 Tester: Gesner Passos

Description

This is a request from the ISIS reflectometry team.

  • Must be able to read the config file at start-up
  • Must give errors for unknown entries
  • Must provide read-only axis to values in the config file
  • Should throw if config file does not exist

After implementing this, it should be possible to provide the specific options that are required for load-time configuration. There are several of these, which should be implemented under separate tickets.

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Blocking 8125 added

comment:2 Changed 7 years ago by Owen Arnold

  • Status changed from new to inprogress

refs #8124. TDD config type.

Config class can be used to provide a consumable and immutable reference to an xml config file. Tests provided.

Changeset: 7f603edaafd40d6efa43a56853ff728b7f2bd482

comment:3 Changed 7 years ago by Owen Arnold

refs #8124. ParseError is version dependent

ParseError seems to be version dependent. Better not to specify the exception type.

Changeset: 4772021f0673e2ea46ebb38f9e83f759129cb5bd

comment:4 Changed 7 years ago by Owen Arnold

  • Status changed from inprogress to verify
  • Resolution set to fixed

Tester. The script below should excercise the code. I think I've provided quite extensive unit test coverage for this feature too.

from isis_reflgui import config
import os

file =  os.path.join( os.path.dirname(config.__file__) , 'config.xml')
conf =  config.Config(file)
print conf.get_all_entries()
print conf.get_named_setting('ArchivePath')
print conf.get_contents_file()

comment:5 Changed 7 years ago by Owen Arnold

refs #8124. Fix path with default constructor.

Need to assume that the config.xml is in the same directory as the config.py module.

Changeset: a16c6b4a30d92429a1963861f84713adf9662990

comment:6 Changed 7 years ago by Owen Arnold

Tester. You should also try to run the script above with no argument to the Config constructor. It should be expected to find the same config.xml file that has been manually injected in the test.

comment:7 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying
  • Tester set to Gesner Passos

comment:8 Changed 7 years ago by Gesner Passos

Just minor things, but:

Code/Mantid/scripts/Reflectometry/isis_reflgui/config.py:28 > Improve the exception string:

  • Wrong file extension. *.xml expected not XML.

Code/Mantid/scripts/Reflectometry/isis_reflgui/config.py:59 > remove this line #pyxsval.parseAndValidateXmlInput(filename, xsdFile=xsdFile, validateSchema=0) #Throws

Code/Mantid/scripts/test/ConfigTest.py:59 > change name of this method:

  • def test_sanity_check_missing_attribute_name_throws
  • def test_sanity_check_missing_attribute_value_throws

comment:9 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:10 Changed 7 years ago by Owen Arnold

  • Status changed from reopened to inprogress

refs #8124. Make changes post code review.

Changeset: a6a54ff9a796ee522c72831c2d26bc112adce52c

comment:11 Changed 7 years ago by Owen Arnold

refs #8124. Remove supplied config file.

Changeset: 319b28e914302e7174b6a11538f58d092cf1c01c

comment:12 Changed 7 years ago by Owen Arnold

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:13 Changed 7 years ago by Gesner Passos

  • Status changed from verify to verifying

comment:14 Changed 7 years ago by Gesner Passos

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8124_reflectometry_config'

Full changeset: 41a69b8bdaabb733aee7df10ff08a82e77591565

comment:15 Changed 7 years ago by Gesner Passos

Passed.

comment:16 Changed 7 years ago by Owen Arnold

  • Blocking 8132 added

comment:17 Changed 7 years ago by Owen Arnold

  • Blocking 8137 added

comment:18 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8969

Note: See TracTickets for help on using tickets.