Doc tests cannot find my new algorithm

Hi I am writing a new algorithm to load DNS PSD data.

I have an example in the docs which runs fine on my local computer, but the doc tests in the Unix build fails because it cannot find my algorithm.
I have no idea, why it cannot find the algorithm in the doc tests, I think I registered it with:

DECLARE_FILELOADER_ALGORITHM(LoadDNSEvent)

Any help is welcome.

Here is the link to the pull request:

Here is the failed test:
https://builds.mantidproject.org/job/pull_requests-ubuntu/48465/testReport/junit/docs/algorithms_LoadDNSEvent-v1/LoadDNSEventex1/

File "algorithms/LoadDNSEvent-v1.rst", line 107, in LoadDNSEventex1
from mantid.simpleapi import *
# data file.
filename = "DNS_psd_pulser_ON473_31.mdat"
Failed example:
    eventWS = LoadDNSEvent(InputFile=filename, ChopperChannel='2')
    print("Number of events: {}".format(eventWS.getNumberEvents()))
    print("Maximum time of flight: {}".format(eventWS.getTofMax()))
    print("Number of detector pixels: {}".format(eventWS.getNumberHistograms()))
    print("Number of bins: {}".format(eventWS.blocksize()))
    # rebin spectra:
    test2 = Rebin(InputWorkspace='eventWS', Params='0, 100, {0}'.format(eventWS.getTofMax()))
    print("Number of bins after rebinning: {}".format(eventWS.blocksize()))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.6/doctest.py", line 1330, in __run
        compileflags, 1), test.globs)
      File "<doctest LoadDNSEventex1
    from mantid.simpleapi import *
    # data file.
    filename = "DNS_psd_pulser_ON473_31.mdat"[0]>", line 1, in <module>
    NameError: name 'LoadDNSEvent' is not defined

Here is the cpp file:

and here is the h file:

I think its because you have not included the files in the CMake definitions (e.g. https://github.com/mantidproject/mantid/blob/ec91046cf05ec20da8fee1904b932df13199b8ae/Framework/DataHandling/CMakeLists.txt )

2 Likes

Oh you are smart, I would never have found that.
I forgot to copy that file.
Thanks a lot.