hipspy / hips

Python library to handle HiPS
https://hips.readthedocs.io
13 stars 16 forks source link

Make a first commit #7

Closed cdeil closed 7 years ago

cdeil commented 7 years ago

@adl1995 - Are you familiar with contributing via Github pull requests?

In any case: could you please make a first commit / contribution to this hips repo, fixing the following test function?

This is meant to be as a check that you're all set for coding / contributing to this repo for GSoC. If you have any issues, e.g. getting dependencies installed, running tests, with git, anything, please comment here and we'll help.

$ make test
python -m pytest hips
====================================================== test session starts =======================================================
platform darwin -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0

Running tests with Astropy version 2.0.dev18379.
Running tests in hips.

Date: 2017-05-28T18:33:31

Platform: Darwin-16.6.0-x86_64-i386-64bit

Executable: /opt/local/bin/python

Full Python Version: 
3.6.1 (default, Apr 24 2017, 06:18:27) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]

encodings: sys: utf-8, locale: UTF-8, filesystem: utf-8
byteorder: little
float info: dig: 15, mant_dig: 15

Numpy: 1.12.1
Scipy: 0.19.0
Matplotlib: 2.0.0
h5py: 2.7.0
Pandas: 0.20.1
Using Astropy options: remote_data: none.

rootdir: /Users/deil/code/hips, inifile: setup.cfg
collected 1 items 

hips/draw/tests/test_simple.py F

============================================================ FAILURES ============================================================
___________________________________________________________ test_hello ___________________________________________________________

    def test_hello():
        meaning_of_life = hello('Adeel')
>       assert meaning_of_life == 43
E       assert 42 == 43

hips/draw/tests/test_simple.py:7: AssertionError
------------------------------------------------------ Captured stdout call ------------------------------------------------------
Hello Adeel
===================================================== pytest-warning summary =====================================================
WC1 None [pytest] section in setup.cfg files is deprecated, use [tool:pytest] instead.
========================================== 1 failed, 1 pytest-warnings in 0.89 seconds ===========================================
make: *** [test] Error 1
adl1995 commented 7 years ago

@cdeil I have made the pull request. However, I have both Python 2 and 3 installed on my system, and I launch Python 3 using python3. So, make test uses Python 2 by default. Is there any way to create an alias so python command uses Python 3 by default?

cdeil commented 7 years ago

If you want to use the Makefile, you could make a pull request replacing all python with python3 in the Makefile? https://github.com/hipspy/hips/blob/master/Makefile

Or just run tests directly:

python3 -m pytest hips
cdeil commented 7 years ago

And yes, you could also create a softlink in one of your bin folders python -> python3 or create an alias in your shell and put that in your shell startup file (for me it's bashrc):

alias python=python3

But those options can be fragile and make your setup weird e.g. when you change to different project / environments.

cdeil commented 7 years ago

This was done by @adl1995 in #8 . Closing issue now.