---
# System prepended metadata

title: PR

---

# PR



**Description of work.**

This PR contains the loader for SANS-1 datafiles.
The loader makes it possible for Mantid to manage the files produced by the SANS-1 instrument at MLZ (ASCII files with extensions `.001`) and reduced files with extension `.002`.

Pull request consists of 3 major files:
1. LoadSANS1MLZ.py (algorithm)
2. SANS1DataMLZ.py (helper file to process and structure data) 
3. LoadSANS1MLZTest.py (tests for processing and loading data into Mantid)

as well as algorithm documentation and supplemental files.

**To test:**
* Load a test file ( such as `UnitTest/D0122881.001` )
* Open the instrument viewer and check if the view works as expected (especially in 3D)

Fixes #34267.

---

#### Reviewer ####

Please comment on the following ([full description](http://developer.mantidproject.org/ReviewingAPullRequest.html)):

##### Code Review #####

- Is the code of an acceptable quality?
- Does the code conform to the [coding standards](http://developer.mantidproject.org/Standards/)?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the [GUI standards](http://developer.mantidproject.org/Standards/GUIStandards.html)?
- If there are changes in the release notes then do they describe the changes appropriately?
- Are the release notes saved in a separate file, using Issue or PR number for file name and in the correct location?

##### Functional Tests #####

- Do changes function as described? Add comments below that describe the tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been added/updated?

Does everything look good? Mark the review as **Approve**. A member of `@mantidproject/gatekeepers` will take care of it.

</br></br></br></br></br></br>

Hello,
Thank you a lot for the review and for such detailed comments. 
I just finished implementing your suggestions in the code review. Below is a short summary of the changes that I made.
1. **The most important comment here is that you created an algorithm but not a loader**
    * Discussed in Marina's comment
2. **The tests**
    * The support of .002 extension was removed from the algorythm, because we decided not to include in the loader support for processed files.
    * All of the other suggestions were implemented.
3. **Use of matrix mode**
    * “Matrix” mode was completely removed from the algorithm to comply with the philosophy of Mantid. 
4. **General comments on the loader**
    * line 167: you can test if the value user_wavelength is set to default instead of testing its value compared to a float. The method for a property is isDefault() - *implemented*
    * line 205: it is disturbing to raise a FileNotFoundError after catching a ValueError - *thanks, I modified it*
    * The loader should contain more comments - *I included several additional comments*




> * line 285: we think, as you mentioned, that the data_x generation will not work if you use TOF data (n>1). Notably, the length of `data_x` should be `self.spectrum_amount()+1`

Currently, the length of the `data_x` is `2 * self.spectrum_amount()`. Could you please explain why it should be changed to `self.spectrum_amount() + 1` ? 

> * We warn you that the value of _Beamstop.setup_ is not close to (0,0), which we think comes from the fact that the coordinates are not the image coordinates (where the center of image is (0,0)

I do not think I am using the values that `Beamstop.setup` takes anywhere in the algorithm, I just read them out. Or I am missing something?




</br></br></br></br></br></br>

Dear Dr. André Heinemann,

I wanted to ask if I can publicly share online one of the *.002 files from the BerSANS tutorial. These file will only be used for testing purposes to verify the correct operation of the data loader.

Best regards,
Andrii Demydenko



