Skip to content
Snippets Groups Projects
Unverified Commit dd18024d authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony Committed by GitHub
Browse files

Merge pull request #26992 from mantidproject/fix_bad_property_name

SaveNexusGeometry property name change
parents 87457364 2c7bc61b
No related branches found
No related tags found
No related merge requests found
...@@ -75,7 +75,7 @@ void SaveNexusGeometry::init() { ...@@ -75,7 +75,7 @@ void SaveNexusGeometry::init() {
"Filename", "", API::FileProperty::OptionalSave), "Filename", "", API::FileProperty::OptionalSave),
"Full path to save destination file"); "Full path to save destination file");
declareProperty("H5Path", "entry" /*default*/, declareProperty("EntryName", "entry" /*default*/,
"(optional) Name of the H5 root group in which the " "(optional) Name of the H5 root group in which the "
"Instrument is to be saved. Default name: 'entry'."); "Instrument is to be saved. Default name: 'entry'.");
} }
...@@ -86,7 +86,7 @@ void SaveNexusGeometry::init() { ...@@ -86,7 +86,7 @@ void SaveNexusGeometry::init() {
void SaveNexusGeometry::exec() { void SaveNexusGeometry::exec() {
API::MatrixWorkspace_const_sptr workspace = getProperty("InputWorkspace"); API::MatrixWorkspace_const_sptr workspace = getProperty("InputWorkspace");
std::string destinationFile = getPropertyValue("FileName"); std::string destinationFile = getPropertyValue("FileName");
std::string rootFileName = getPropertyValue("H5Path"); std::string rootFileName = getPropertyValue("EntryName");
auto ws = workspace.get(); auto ws = workspace.get();
const auto &compInfo = ws->componentInfo(); const auto &compInfo = ws->componentInfo();
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
TS_ASSERT_THROWS_NOTHING(alg.setProperty("InputWorkspace", "testWS")); TS_ASSERT_THROWS_NOTHING(alg.setProperty("InputWorkspace", "testWS"));
TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("FileName", destinationFile)); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("FileName", destinationFile));
TS_ASSERT_THROWS_NOTHING( TS_ASSERT_THROWS_NOTHING(
alg.setPropertyValue("H5Path", "algorithm_test_data")); alg.setPropertyValue("EntryName", "algorithm_test_data"));
TS_ASSERT_THROWS_NOTHING(alg.execute()); TS_ASSERT_THROWS_NOTHING(alg.execute());
TS_ASSERT(alg.isExecuted()); TS_ASSERT(alg.isExecuted());
......
...@@ -30,9 +30,7 @@ Usage ...@@ -30,9 +30,7 @@ Usage
import os import os
ws = CreateSampleWorkspace() ws = CreateSampleWorkspace()
compInfo = ws.componentInfo() file_name = "example_save_nexus_geometry.nxs"
detInfo = ws.detectorInfo()
file_name = "example_save_Nexus_geometry_1.nxs"
path = os.path.join(os.path.expanduser("~"), file_name) path = os.path.join(os.path.expanduser("~"), file_name)
SaveNexusGeometry(ws, path) SaveNexusGeometry(ws, path)
...@@ -59,45 +57,6 @@ Output: ...@@ -59,45 +57,6 @@ Output:
removeFiles([file_name]) removeFiles([file_name])
**Example - basic example using SaveNexusGeometry, with specific H5 root group**
.. testcode:: SaveNexusGeometryExampleOption
import os
ws = CreateSampleWorkspace()
compInfo = ws.componentInfo()
detInfo = ws.detectorInfo()
file_name = "example_save_Nexus_geometry_2.hdf5"
path = os.path.join(os.path.expanduser("~"), file_name)
SaveNexusGeometry(ws, path)
print(os.path.isfile(path))
Output:
.. testoutput:: SaveNexusGeometryExampleOption
True
.. testcleanup:: SaveNexusGeometryExampleOption
import os
def removeFiles(files):
for ws in files:
try:
path = os.path.join(os.path.expanduser("~"), ws)
os.remove(path)
except:
pass
removeFiles([file_name])
.. categories:: .. categories::
.. sourcelink:: .. sourcelink::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment