roban / cosmolopy Goto Github PK
View Code? Open in Web Editor NEWa basic numpy/scipy-based cosmology package for python
Home Page: http://roban.github.com/CosmoloPy/
License: Other
a basic numpy/scipy-based cosmology package for python
Home Page: http://roban.github.com/CosmoloPy/
License: Other
$ 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.
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:
requirements.txt
, so this fails.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'
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
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'
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?
The about section gives as link: roban.github.com/CosmoloPy/
The same link is also in the README.
The correct link is: https://roban.github.io/CosmoloPy/
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.