Giter Club home page Giter Club logo

cosmolopy's People

Contributors

1313e avatar aaronkebede avatar astroduff avatar johannesbuchner avatar jostmigenda avatar roban avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cosmolopy's Issues

failed to build on macos X

Got error:

Downloads/cosmolopy-0.4.1/cosmolopy/EH/tf_fit.c:154:2: error: implicitly declaring library function 'exit' with type 'void (int) attribute((noreturn))' [-Werror,-Wimplicit-function-declaration]
exit(1);
^
/Users/gq/Downloads/cosmolopy-0.4.1/cosmolopy/EH/tf_fit.c:154:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'

which is due to that since Xcode 12, implicit declaration is an error whereas previously it was just a warning. It should be fixed by including the necessary headers.

include the header file <stdlib.h> in tf_fit.c can fix the rror

power.c: incompatible implicit declaration of built-in function 'exit'

power.c is missing include <stdlib.h> statement which results in:

x86_64-pc-linux-gnu-gcc -pthread -O2 -pipe -Wimplicit-function-declaration -fPIC -I/usr/include/python2.7 -c ./cosmolopy/EH/power.c -o build-2.7/temp.linux-x86_64-2.7/./cosmolopy/EH/power.o
./cosmolopy/EH/power.c: In function 'TFmdm_set_cosm':
./cosmolopy/EH/power.c:136:2: warning: implicit declaration of function 'exit'
./cosmolopy/EH/power.c:136:2: warning: incompatible implicit declaration of built-in function 'exit'
./cosmolopy/EH/power.c:143:2: warning: incompatible implicit declaration of built-in function 'exit'

pip install fails in Python ≥3.8

Installing via pip install cosmolopy==0.4 fails under Python 3.8 and newer with the following error message:

    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/_v/z0wcz3kd1y5_0565c99_pqcw0000gn/T/pip-install-9gkkksqw/cosmolopy_d5ebe232f15d40c39ed797a98dc269fb/setup.py", line 51, in <module>
        with open(path.join(dirpath, 'requirements.txt'), 'r') as f:
    FileNotFoundError: [Errno 2] No such file or directory: '/private/var/folders/_v/z0wcz3kd1y5_0565c99_pqcw0000gn/T/pip-install-9gkkksqw/cosmolopy_d5ebe232f15d40c39ed797a98dc269fb/requirements.txt'

After looking at PyPI, here’s what I think is happening:

  • For Python ≤3.7, there’s a pre-built wheel available, so pip will install that successfully.
  • For Python ≥3.8, since there’s no pre-built wheel, it will download the source and try to install from that. However, the source package doesn’t contain a file named requirements.txt, so this fails.

pip install fails: No such file or directory: 'swig'

$ pip install cosmolopy
Collecting cosmolopy
  Downloading cosmolopy-0.4.1.tar.gz (47 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 47.5/47.5 kB 3.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.12.0 in ./workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/site-packages (from cosmolopy) (1.23.4)
Requirement already satisfied: scipy>=1.0.0 in ./workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/site-packages (from cosmolopy) (1.9.1)
Building wheels for collected packages: cosmolopy
  Building wheel for cosmolopy (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      Swigging sources
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/setup.py", line 30, in <module>
          generate_swig()
        File "/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/setup.py", line 22, in generate_swig
          p = subprocess.call(['swig', '-python', filename],
        File "/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/subprocess.py", line 345, in call
          with Popen(*popenargs, **kwargs) as p:
        File "/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/subprocess.py", line 969, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/subprocess.py", line 1845, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: 'swig'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for cosmolopy
  Running setup.py clean for cosmolopy
Failed to build cosmolopy
WARNING: Error parsing requirements for mamba: [Errno 2] No such file or directory: '/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/site-packages/mamba-0.27.0.dist-info/METADATA'
Installing collected packages: cosmolopy
  Running setup.py install for cosmolopy ... error
  error: subprocess-exited-with-error
  
  × Running setup.py install for cosmolopy did not run successfully.
  │ exit code: 1
  ╰─> [37 lines of output]
      running install
      /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/luminosityfunction.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/saveable.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/magnitudes.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/perturbation.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/__init__.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/reionization.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/__version__.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/constants.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/utils.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/parameters.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/density.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      copying cosmolopy/distance.py -> build/lib.linux-x86_64-cpython-310/cosmolopy
      creating build/lib.linux-x86_64-cpython-310/cosmolopy/EH
      copying cosmolopy/EH/__init__.py -> build/lib.linux-x86_64-cpython-310/cosmolopy/EH
      copying cosmolopy/EH/LISCENSE -> build/lib.linux-x86_64-cpython-310/cosmolopy/EH
      running build_ext
      building 'cosmolopy.EH._power' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/tmp
      creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv
      creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02
      creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy
      creating build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH
      gcc -pthread -B /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include -fPIC -O2 -isystem /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include -fPIC -I/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include/python3.10 -c /tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH/power.c -o build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH/power.o
      gcc -pthread -B /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include -fPIC -O2 -isystem /home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include -fPIC -I/home/idies/workspace/Storage/jbuchner/persistent/condaenvs/cigale/include/python3.10 -c /tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH/power_wrap.c -o build/temp.linux-x86_64-cpython-310/tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH/power_wrap.o
      gcc: error: /tmp/pip-install-vb137eiv/cosmolopy_6d17f996a2d54cb1ae09fd9b1eed2c02/cosmolopy/EH/power_wrap.c: No such file or directory
      gcc: fatal error: no input files
      compilation terminated.
      error: command '/home/idies/miniconda3/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cosmolopy

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

This is solved by installing swig.

I only open the issue to document this.

Do not work in python3

The package does not seem to work in Python3, but it does in python2.
The package does not have a version either, which is usefull when looking into changes.

    import cosmolopy.perturbation as pert
  File "<me>/.local/lib/python3.6/site-packages/cosmolopy/__init__.py", line 88, in <module>
    import constants as cc
ModuleNotFoundError: No module named 'constants'

main directory in tarballs contains git hash

I'm currently trying to package CosmoloPy for Gentoo linux. I would be very grateful if main directory was some deriverate of pkg's NAME and VERSION rather than:
roban-NAME-HASH
Thanks in advance,
Kacper Kowalik

probably a correction needed in a magnitude_AB function

In magnitudes.magnitude_AB function I see the observed frequency nu_0 is never used later in the function but still being computed. I guess in the next line where ab_app is computed this is where the unused nu_0 term should go instead of nu_rest?

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.