Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Muon PhaseQuad documentation and user examples #324

Merged
merged 4 commits into from Mar 3, 2015

Conversation

raquelalvarezbanos
Copy link
Contributor

Fixes #11191

To test: this ticket is to update the algorithm's documentation, so basically the only two things to test here are the user examples.

@raquelalvarezbanos raquelalvarezbanos added Muon Issues and pull requests related to muons Documentation Issues and pull requests related to documentation labels Mar 2, 2015
@raquelalvarezbanos raquelalvarezbanos added this to the Release 3.4 milestone Mar 2, 2015
@martyngigg martyngigg self-assigned this Mar 2, 2015
# Load the first two spectra from a MUSR run
input = LoadMuonNexus('MUSR0015189.nxs',EntryNumber=1,SpectrumMin=1,SpectrumMax=2)
# Load a set of spectra from a EMU file
ws = LoadMuonNexus('EMU00006473.nxs')

# Create a PhaseList file with some arbitrary detector information
file = open('PhaseList.txt','w')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing wrong with the line here, however, on some users' machines the current working directory is not writeable so this example may not work out of the box. In most of our examples that write files we tend to use the home directory, which is easy to access in Python. Can we change this line to something like

phaselist_path = os.path.join(os.path.expanduser("~"),"PhaseList.txt")
phaselist_file = open(phaselist_path, 'w')

Note that I have also replaced file withphaselist_file as file is a keyword in Python and is generally considered bad practice to over write keywords.

@martyngigg
Copy link
Member

Could we also remove the temporary PhaseList file after we are finished? This just avoids having random files scattered around the build directories. This can be done outside of the test by adding the following lines underneath the .. testoutput:: ExPhaseQuadList section:

.. testcleanup:: ExPhaseQuadList

  import os
  try:
      os.remove(phaselist_path)
  except OSError:
      pass

See CreateDummyCalFile-v1.rst for an example.

@raquelalvarezbanos
Copy link
Contributor Author

Sure, I will remove the file. Thanks Martyn

@raquelalvarezbanos
Copy link
Contributor Author

I have just seen I missed the first comment, I will modify that too.

@raquelalvarezbanos
Copy link
Contributor Author

Jenkins, retest this please

@martyngigg
Copy link
Member

It looks like this doesn't merge cleanly with master any more. Could you merge master to your branch?

@martyngigg
Copy link
Member

Jenkins, retest this please

1 similar comment
@raquelalvarezbanos
Copy link
Contributor Author

Jenkins, retest this please

@martyngigg
Copy link
Member

One of the builds has failed with a git error. I don't think it is worth pushing this through the build servers again. I'll just wait until the build finish and merge it then.

@martyngigg
Copy link
Member

The rhel6 failure is nothing to do with the changes here. The documentation tests have passed and rhel6 built before.

martyngigg added a commit that referenced this pull request Mar 3, 2015
Update Muon PhaseQuad documentation and user examples
@martyngigg martyngigg merged commit a759afa into master Mar 3, 2015
@martyngigg martyngigg deleted the 11191_update_PhaseQuad_doc branch March 3, 2015 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Issues and pull requests related to documentation Muon Issues and pull requests related to muons
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants