GithubHelp home page GithubHelp logo

Running Tests about piff HOT 12 CLOSED

rmjarvis avatar rmjarvis commented on September 26, 2024
Running Tests

from piff.

Comments (12)

rmjarvis avatar rmjarvis commented on September 26, 2024

My best guess is that you have python <= 2.7.8. There was a bug related to this that was fixed in python 2.7.9.

from piff.

jmeyers314 avatar jmeyers314 commented on September 26, 2024

Sounds like you're also missing the nosetests package. You should be able to install this via pip install nose, or if you're using Anaconda python, conda install nose.

@rmjarvis, is it worth adding nose to requirements.txt? It's not strictly required outside of tests I suppose, but I think it's unlikely to cause problems if we do add it.

from piff.

rmjarvis avatar rmjarvis commented on September 26, 2024

I think technically, that kind of thing should be in a dev-requirements.txt file.

cf. http://setupext-pip.readthedocs.io/en/latest/requirements-files.html

I have no objection to adding it there.

from piff.

areshernandez avatar areshernandez commented on September 26, 2024

I was using the version of python that came with my mac (which was 2.7.6). I installed python version 2.7.13 from the python website. It seems that Galsim and other python packages from my old python did not migrate to the new version of python I just installed.

If I decide to install Galsim (and all of the python packages it requires) again is there anything I have to do when re-installing it to make sure it will install on python 2.7.13 rather than the old 2.7.6 (which already has Galsim)? Alternatively, is there a way to automatically migrate all of the python packages I have from python 2.7.6 (which came with my mac) to the new version of python I just installed?

from piff.

aaronroodman avatar aaronroodman commented on September 26, 2024

from piff.

rmjarvis avatar rmjarvis commented on September 26, 2024

Yes, the PYTHONPATH environment variable should be set correctly.

And you will need to reinstall all the various packages you need. numpy, fitsio, astropy, etc. Using pip is usually a good way to go with that, since many of the more popular packages have binary installations, so it's not usually too onerous to install them.

While you're at it, install nose as well, so you can use nosetests to run the tests.

from piff.

areshernandez avatar areshernandez commented on September 26, 2024

Galsim, Piff, and Nose packages are successfully installed. I ran the nosetests for Piff. It mostly worked but it failed one test out of 56. Specifically,

FAIL: Initial simple test of Gaussian, Kolmogorov, and Moffat PSFs.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/areshernandez/lsstsw/miniconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/Users/areshernandez/Piff-master/tests/piff_test_helper.py", line 78, in f2
    result = f(*args, **kwargs)
  File "/Users/areshernandez/Piff-master/tests/test_gsobject_model.py", line 189, in test_simple
    np.testing.assert_allclose(fit.params[2], g2, rtol=0, atol=1e-6)
  File "/Users/areshernandez/lsstsw/miniconda/lib/python2.7/site-packages/numpy/testing/utils.py", line 1392, in assert_allclose
    verbose=verbose, header=header)
  File "/Users/areshernandez/lsstsw/miniconda/lib/python2.7/site-packages/numpy/testing/utils.py", line 739, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Not equal to tolerance rtol=0, atol=1e-06

(mismatch 100.0%)
 x: array(-0.16999878078849628)
 y: array(-0.17)

It seems that this failure was due to something being only slightly off (but out of the strict tolerance range it had). Do you have an idea as to why this test failed? Have you encountered this nosetest failure before?

from piff.

rmjarvis avatar rmjarvis commented on September 26, 2024

Do you have an idea as to why this test failed?

Yes. This was related to a change in the precision of some GalSim operations. I ran into this and fixed it on branch alternate_wcs, currently in PR. If you want to install that branch, feel free. Or just ignore this error, since it will eventually be merged into master.

from piff.

areshernandez avatar areshernandez commented on September 26, 2024

After installing Piff on my personal laptop I tried installing it on my work computer as well. I tried to do it using the LSST stack method. I ran (in my home directory):

git clone https://github.com/lsst/lsstsw.git
cd lsstsw
./bin/deploy

I confirmed that a new lsstsw directory appeared in my home directory, as expected. However, something went wrong when I used "./bin/deploy." It gave me this error:

Output written on eups.pdf (43 pages, 351429 bytes).
Transcript written on eups.log.
Running latex2html
/bin/sh: latex2html: command not found
latex2html failed; writing dummy eups.html
make[1]: Leaving directory `/afs/slac.stanford.edu/u/ec/aresh/lsstsw/sources/eups-2.1.3/doc'
cp Makefile README  Release_Notes gpl.txt "/u/ec/aresh/lsstsw/eups/2.1.3"
echo "`env EUPS_DIR=. PYTHONPATH=python bin/eups --version 2>&1 | awk '/Version/ {print $3}'`" > "/u/ec/aresh/lsstsw/eups/2.1.3/git.version"
Remember to source /u/ec/aresh/lsstsw/eups/2.1.3/bin/setups.{c,z,}sh
::: Making eups 2.1.3 the default
::: Deploying manifest.remap
::: Deploying versiondb
Cloning into 'versiondb'...
remote: Counting objects: 117813, done.
remote: Compressing objects: 100% (325/325), done.
remote: Total 117813 (delta 252), reused 253 (delta 100), pack-reused 117388
Receiving objects: 100% (117813/117813), 57.73 MiB | 18.86 MiB/s, done.
Resolving deltas: 100% (108096/108096), done.
fatal: fsync error on '/afs/slac.stanford.edu/u/ec/aresh/lsstsw/versiondb/.git/objects/pack/tmp_pack_5JldJf': Disk quota exceeded
fatal: index-pack failed

I'm not sure what went wrong. It said "disk quota exceeded." Does that mean there was not enough room remaining on the computer for something from lsst?

from piff.

cpadavis avatar cpadavis commented on September 26, 2024

from piff.

jmeyers314 avatar jmeyers314 commented on September 26, 2024

There's a GalSim installation at slac at /nfs/slac/g/ki/ki19/jmeyers3/src/GalSim/. If you add

export PATH=/nfs/slac/g/ki/ki19/jmeyers3/miniconda2/bin:$PATH
source eups-setups.sh
setup galsim

to your .bash_profile, I think it should work. I too will be in tomorrow for potential debugging if that doesn't do it.

from piff.

rmjarvis avatar rmjarvis commented on September 26, 2024

I'm not sure what any of this has to do with Piff. Piff doesn't require the lsst stack. Aside from GalSim, you should be able to get all dependencies of Piff installed with pip install piff. (And GalSim will soon be similarly installable...)

from piff.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.