Code Monkey home page Code Monkey logo

Comments (21)

beckermr avatar beckermr commented on September 11, 2024 1

Rebuild is merged. This issue can be closed. Should be ready in a few hours.

from namaster.

beckermr avatar beckermr commented on September 11, 2024 1

Sure sure understood. We are trying to tag v2 so I wanted to make sure nothjng was actually broken.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

I am rebuilding the conda package. It was simply out of date. Try again in a bit!

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

I attempted another install of NaMaster through conda and apparently it still tries to install gsl=2.5, instead of gsl=2.6+.
I did this twice, one time trying with just conda install -c conda-forge namaster, and another one (after I had looked up conda search namaster to see which is the latest version) with conda install -c conda-forge namaster=1.0. It is still conflicting with gsl, and here are the packages it is trying to install:

  chealpix           conda-forge/linux-64::chealpix-3.30.0-h14c3975_1000
  fftw               conda-forge/linux-64::fftw-3.3.8-nompi_h7f3a6c3_1109
  gsl                conda-forge/linux-64::gsl-2.5-h294904e_1
  libsharp           conda-forge/linux-64::libsharp-1.0.0-h14c3975_1000
  namaster           conda-forge/linux-64::namaster-1.0-py37heade8f8_1

Am I doing something wrong? Where is the fixed version located?

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

At the moment, I have found a workaround by building CCL and creating a symbolic link in my conda environment pointing to the pyccl directory in the CCL build, so it is not very urgent.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Conda forge globally uses a single version of gsl. It is currently 2.5. This ensures that all codes can use the same env. If the install works with 2.5, then there is no bug. It sounds like it does, right?

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Ahhh wait. I see the issue. It is pyccl. Let me fix it

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Alright. It turns out pyccl was using the wrong version of gsl for technical reasons related to conda. I think this is fixed now. Try again in a bit and sorry for the trouble!

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

Alright, thanks a lot, it w̶o̶r̶k̶s̶ (doesn't work) now. No package conflicts but CCL rc3, which is the most recent version of CCL on conda, is broken. This is not an issue with NaMaster though, so I am closing this and opening a new issue on CCL's page.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

What is broken with it?

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Everything works great for me

(anl) localhost:~ Matt$ conda install pyccl
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/Matt/miniconda3/envs/anl

  added / updated specs:
    - pyccl


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    camb-1.0.6                 |   py37hb7221d7_3         878 KB  conda-forge
    gfortran_impl_osx-64-7.3.0 |       hf4212f2_2         9.3 MB  conda-forge
    gfortran_osx-64-7.3.0      |       h22b1bf0_6          21 KB  conda-forge
    gsl-2.5                    |       ha2d443c_1         2.7 MB  conda-forge
    isl-0.19                   |                0         1.3 MB  conda-forge
    pycamb-1.0.6               |           py37_3          33 KB  conda-forge
    pyccl-2.0.0rc3             |   py37h96385ee_2         642 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        14.8 MB

The following NEW packages will be INSTALLED:

  camb               conda-forge/osx-64::camb-1.0.6-py37hb7221d7_3
  cctools            conda-forge/osx-64::cctools-921-h5ba7a2e_4
  clang              conda-forge/osx-64::clang-9.0.0-h28b9765_1
  fastcache          conda-forge/osx-64::fastcache-1.1.0-py37h01d97ff_0
  gfortran_impl_osx~ conda-forge/osx-64::gfortran_impl_osx-64-7.3.0-hf4212f2_2
  gfortran_osx-64    conda-forge/osx-64::gfortran_osx-64-7.3.0-h22b1bf0_6
  gmp                conda-forge/osx-64::gmp-6.1.2-h0a44026_1000
  gmpy2              conda-forge/osx-64::gmpy2-2.1.0b1-py37h1744cca_0
  gsl                conda-forge/osx-64::gsl-2.5-ha2d443c_1
  isl                conda-forge/osx-64::isl-0.19-0
  ld64               conda-forge/osx-64::ld64-409.12-h3c32e8a_4
  libllvm9           conda-forge/osx-64::libllvm9-9.0.0-h770b8ee_2
  mpc                conda-forge/osx-64::mpc-1.1.0-h3aece09_1006
  mpfr               conda-forge/osx-64::mpfr-4.0.2-h44b798e_0
  mpmath             conda-forge/noarch::mpmath-1.1.0-py_0
  pycamb             conda-forge/osx-64::pycamb-1.0.6-py37_3
  pyccl              conda-forge/osx-64::pyccl-2.0.0rc3-py37h96385ee_2
  sympy              conda-forge/osx-64::sympy-1.4-py37_0
  tapi               conda-forge/osx-64::tapi-1000.10.8-h770b8ee_3


Proceed ([y]/n)? y


Downloading and Extracting Packages
pycamb-1.0.6         | 33 KB     | ############################################################################################################################################################# | 100% 
gfortran_impl_osx-64 | 9.3 MB    | ############################################################################################################################################################# | 100% 
gsl-2.5              | 2.7 MB    | ############################################################################################################################################################# | 100% 
isl-0.19             | 1.3 MB    | ############################################################################################################################################################# | 100% 
pyccl-2.0.0rc3       | 642 KB    | ############################################################################################################################################################# | 100% 
gfortran_osx-64-7.3. | 21 KB     | ############################################################################################################################################################# | 100% 
camb-1.0.6           | 878 KB    | ############################################################################################################################################################# | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
INFO: deactivate-gfortran_osx-64.sh made the following environmental changes:
+LDFLAGS=-Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/Matt/miniconda3/lib -L/Users/Matt/miniconda3/lib
(anl) localhost:~ Matt$ ipy
Python 3.7.3 | packaged by conda-forge | (default, Jul  1 2019, 14:38:56) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.8.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import pyccl as ccl 
   ...: import numpy as np 
   ...:  
   ...: # Create new Cosmology object with a given set of parameters. This keeps track 
   ...: # of previously-computed cosmological functions 
   ...: cosmo = ccl.Cosmology( 
   ...:     Omega_c=0.27, Omega_b=0.045, h=0.67, sigma8=0.8, n_s=0.96, 
   ...:     transfer_function='bbks') 
   ...:  
   ...: # Define a simple binned galaxy number density curve as a function of redshift 
   ...: z_n = np.linspace(0., 1., 200) 
   ...: n = np.ones(z_n.shape) 
   ...:  
   ...: # Create objects to represent tracers of the weak lensing signal with this 
   ...: # number density (with has_intrinsic_alignment=False) 
   ...: lens1 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...: lens2 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...:  
   ...: # Calculate the angular cross-spectrum of the two tracers as a function of ell 
   ...: ell = np.arange(2, 10) 
   ...: cls = ccl.angular_cl(cosmo, lens1, lens2, ell) 
   ...: print(cls)                                                                                                                                                                                      
[8.66780883e-09 1.17822402e-08 1.30401125e-08 1.35000276e-08
 1.35645508e-08 1.34173983e-08 1.31528650e-08 1.28233003e-08]

from namaster.

beckermr avatar beckermr commented on September 11, 2024

CAMB works too

In [2]: import pyccl as ccl 
   ...: import numpy as np 
   ...:  
   ...: # Create new Cosmology object with a given set of parameters. This keeps track 
   ...: # of previously-computed cosmological functions 
   ...: cosmo = ccl.Cosmology( 
   ...:     Omega_c=0.27, Omega_b=0.045, h=0.67, sigma8=0.8, n_s=0.96) 
   ...:  
   ...: # Define a simple binned galaxy number density curve as a function of redshift 
   ...: z_n = np.linspace(0., 1., 200) 
   ...: n = np.ones(z_n.shape) 
   ...:  
   ...: # Create objects to represent tracers of the weak lensing signal with this 
   ...: # number density (with has_intrinsic_alignment=False) 
   ...: lens1 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...: lens2 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...:  
   ...: # Calculate the angular cross-spectrum of the two tracers as a function of ell 
   ...: ell = np.arange(2, 10) 
   ...: cls = ccl.angular_cl(cosmo, lens1, lens2, ell) 
   ...: print(cls)                                                                                                                                                                                      
[9.31280743e-09 1.26656483e-08 1.40114330e-08 1.44869501e-08
 1.45274865e-08 1.43334458e-08 1.40087568e-08 1.36118779e-08]

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

I was about to open an issue on CCL's page, but since you're asking:
Try running ccl.halo_bias(cosmo, 1e14, 1), for example, and you get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/koukoufilippasn/anaconda3/envs/spyder4b/lib/python3.7/site-packages/pyccl/massfunction.py", line 70, in halo_bias
    lib.halo_bias_vec, cosmo, halo_mass, a, overdensity)
  File "/home/koukoufilippasn/anaconda3/envs/spyder4b/lib/python3.7/site-packages/pyccl/pyutils.py", line 281, in _vectorize_fn4
    check(status, cosmo_in)
  File "/home/koukoufilippasn/anaconda3/envs/spyder4b/lib/python3.7/site-packages/pyccl/pyutils.py", line 29, in check
    raise CCLError("Error %s: %s" % (error_types[status], msg))
pyccl.errors.CCLError: Error CCL_ERROR_MF: ccl_massfunc.c: ccl_halo_b1(): No b(M) fitting function implemented for mass_function_method: 1 

PS: Only CCL rc3 can be installed alongside NaMaster with conda, if someone tries to install an older version (currently the only other available is rc2), they still get package conflicts with gsl.

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

WeakLensingTracer works fine for me too.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Your mass function may not have a bias function. Which one are you using?

from namaster.

beckermr avatar beckermr commented on September 11, 2024
In [1]: import pyccl as ccl 
   ...: import numpy as np 
   ...:  
   ...: # Create new Cosmology object with a given set of parameters. This keeps track 
   ...: # of previously-computed cosmological functions 
   ...: cosmo = ccl.Cosmology( 
   ...:     Omega_c=0.27, Omega_b=0.045, h=0.67, sigma8=0.8, n_s=0.96) 
   ...:  
   ...: # Define a simple binned galaxy number density curve as a function of redshift 
   ...: z_n = np.linspace(0., 1., 200) 
   ...: n = np.ones(z_n.shape) 
   ...:  
   ...: # Create objects to represent tracers of the weak lensing signal with this 
   ...: # number density (with has_intrinsic_alignment=False) 
   ...: lens1 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...: lens2 = ccl.WeakLensingTracer(cosmo, dndz=(z_n, n)) 
   ...:  
   ...: # Calculate the angular cross-spectrum of the two tracers as a function of ell 
   ...: ell = np.arange(2, 10) 
   ...: cls = ccl.angular_cl(cosmo, lens1, lens2, ell) 
   ...: print(cls)                                                                                                                                                                                      
[9.31280743e-09 1.26656483e-08 1.40114330e-08 1.44869501e-08
 1.45274865e-08 1.43334458e-08 1.40087568e-08 1.36118779e-08]

In [2]: ccl.halo_bias(cosmo, 1e14, 1)                                                                                                                                                                   
Out[2]: 1.8196490114414752

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Only tinker10 and shethtormen have bias functions.

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

Yes, if I remember correctly @damonge helped me to hard code the bias function before building CCL, and this is still work in progress. I use the 'tinker' mass function.

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

And I've seen that on CCL's page it has been suggested that mixed models should be allowed in case anyone wants to try new stuff. So don't worry about it for now. Thanks a lot for your help!

from namaster.

beckermr avatar beckermr commented on September 11, 2024

So the tinker mass function does not have a bias function

Use tinker10 and it will work.

from namaster.

nikfilippas avatar nikfilippas commented on September 11, 2024

Yes, yes, but mixed models is another issue which is currently on the table for CCL. (For example, one might want to define a 'tinker' cosmology object, but use the 'tinker10' bias function.)
Thanks again Matt!

from namaster.

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.