Difference between revisions of "ScatterSim:Installing"

From GISAXS
Jump to: navigation, search
(Created page with "== Installing ScatterSim == Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method. <ol> <li> Download and...")
 
(Installing ScatterSim)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Installing ScatterSim ==
 
== Installing ScatterSim ==
Here are some rough guidelines into installing ScatterSim. There are a few ways to do it, but this is a recommended method.
+
Here are some rough guidelines into installing ScatterSim.
  
 
<ol>
 
<ol>
<li>
+
  <li>
 
Download and install Anaconda <br />
 
Download and install Anaconda <br />
 
https://www.continuum.io/downloads
 
https://www.continuum.io/downloads
</li>
+
  </li>
  
<li>
+
  <li> Download the ScatterSim Library, either:
 +
 
 +
  <ol>
 +
    <li> Direct download
 +
    <ol>
 +
    <li>Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip <br />
 +
and install to the directory of your choice.
 +
 
 +
    </li>
 +
   
 +
  </ol></li>
 +
 
 +
  <li>
 +
    Using git
 +
    <ol><li>
 
Download and install git: <br />
 
Download and install git: <br />
  
 
https://git-scm.com/downloads
 
https://git-scm.com/downloads
 
+
    </li>
</li>
+
    <li>
<li>
+
  Download the ScatterSim library using git
Download the ScatterSim library using git
+
    <ol>
<ol>
+
      <li> Open a terminal and choose a directory where you want to install ScatterSim, for example:
<li> Open a terminal and choose a directory where you want to install ScatterSim, for example:
 
 
<pre>
 
<pre>
 
cd ~/
 
cd ~/
Line 23: Line 36:
 
cd software
 
cd software
 
</pre>
 
</pre>
</li>
+
      </li>
<li>
+
 
Download and install ScatterSim using git:
+
      <li>clone:<br/>
<ol>
 
<li>Download using git:<br/>
 
  
 
<pre>
 
<pre>
 
git clone https://github.com/CFN-softbio/ScatterSim.git
 
git clone https://github.com/CFN-softbio/ScatterSim.git
 
</pre>
 
</pre>
</li>
+
(For more information, you may also visit the [http://github.com/CFN-softbio/ScatterSim github page])
</li>
+
      </li>
<li>
+
    </ol>
 +
    </li>
 +
</ol></li>
 +
</ol></li>
 +
    <li>
 
Now install ScatterSim   
 
Now install ScatterSim   
 
<pre>
 
<pre>
Line 41: Line 56:
 
</pre>
 
</pre>
 
It should now be installed.
 
It should now be installed.
</li>
+
 
</li>
+
   
</ol>
+
  </ol>
<li>
+
 
 +
 
 +
 
 
You should be able to now run ScatterSim in a python environment.
 
You should be able to now run ScatterSim in a python environment.
</ol>
 
  
 
== Testing ScatterSim ==
 
== Testing ScatterSim ==

Latest revision as of 17:33, 18 July 2017

Installing ScatterSim

Here are some rough guidelines into installing ScatterSim.

  1. Download and install Anaconda
    https://www.continuum.io/downloads
  2. Download the ScatterSim Library, either:
    1. Direct download
      1. Download from https://github.com/CFN-softbio/SciAnalysis/archive/master.zip
        and install to the directory of your choice.
    2. Using git
      1. Download and install git:
        https://git-scm.com/downloads
      2. Download the ScatterSim library using git
        1. Open a terminal and choose a directory where you want to install ScatterSim, for example:
          cd ~/
          mkdir -p software
          cd software
          
        2. clone:
          git clone https://github.com/CFN-softbio/ScatterSim.git
          

          (For more information, you may also visit the github page)

  3. Now install ScatterSim
    cd ScatterSim
    python setup.py develop
    

    It should now be installed.



You should be able to now run ScatterSim in a python environment.

Testing ScatterSim

To test that ScatterSim was properly installed, let's make a folder where we can add code and test.

  1. Create a folder where you'll want to store your notebooks, for example, in a terminal, type:
    cd ~/software
    mkdir -p ScatterSim-examples
    cd ScatterSim-examples
    
  2. In this folder, in the terminal, type:
    jupyter notebook
    

    This will open your web browser to run jupyter notebooks.

  3. Click "New" and select one of the entries under "Notebook". Likely it will say something like "Python 3" or something similar. You should only have one entry (unless you've manually created extra notebook kernels, or installed jupyter on its own).
  4. To test that ScatterSim is installed, type in a cell:
    from ScatterSim.NanoObjects import SphereNanoObject
    

    and hit SHIFT + ENTER. If you do not receive an error, then it is installed. If you do receive an error, then try to use another kernel (the entries under notebook mentioned in the previous step).

Troubleshooting If this was not successful, then here are some things you may try:

  • you have two instances of jupyter installed and you are not running the correct one. Try to find them and uninstall everything. The command (linux/mac)
    which jupyter
    can help hint where the jupyter version you're using is installed.
  • Another possibilty is that you are not in the right conda environment. Simply closing your terminal and opening it again could help. Else, you may need to find out the name of your conda environments by typing in a terminal:
    conda env list
    

    and finally selecting the correct environment by typing:

    source activate ENV
    

    where ENV is one of the names in the list you saw. (it should be one entry unless you've purposely added more environments)


Updating ScatterSim

If you installed using git, you can also update ScatterSim using git. When an update is pushed to the server, it may be retrieved as follows:

  1. Go into ScatterSim directory. Ex:
    cd ~/software/ScatterSim
    
  2. Then run the following two commands:
    git checkout master
    git pull origin master
    

NOTE : If you made any changes to ScatterSim, git will complain (this could happen by accidentally opening a file and adding in a whitespace for example). To resolve this, you delete all changes you may have made by typing:

git reset --hard

If you wanted to keep your changes, then one option is to create a new branch for them, such as: may either need to add the changes:

git checkout -b development-branch-name
git add <files...>
git commit -m "MY Commit message for these edits"

Now your changes are saved and may always be accessed by running:

git checkout development-branch-name

This is likely unnecessary, unless you are digging into the code.