diff --git a/camb/__init__.py b/camb/__init__.py index 6a344ab3..63678b18 100644 --- a/camb/__init__.py +++ b/camb/__init__.py @@ -7,7 +7,7 @@ __author__ = "Antony Lewis" __contact__ = "antony at cosmologist dot info" __url__ = "https://camb.readthedocs.io" -__version__ = "1.5.2" +__version__ = "1.5.3" from . import baseconfig diff --git a/camb/cambdll.dll b/camb/cambdll.dll index 89511d92..e2cb2f90 100644 Binary files a/camb/cambdll.dll and b/camb/cambdll.dll differ diff --git a/camb/dark_energy.py b/camb/dark_energy.py index 1cf5642c..96f5f23a 100644 --- a/camb/dark_energy.py +++ b/camb/dark_energy.py @@ -94,6 +94,12 @@ def validate_params(self): if self.wa and (self.w < -1 - 1e-6 or 1 + self.w + self.wa < - 1e-6): raise CAMBError('fluid dark energy model does not support w crossing -1') + def set_w_a_table(self, a, w): + # check w array has elements that are all the same sign or zero + if np.sign(1 + np.max(w)) - np.sign(1 + np.min(w)) == 2: + raise ValueError('fluid dark energy model does not support w crossing -1') + super().set_w_a_table(a, w) + @fortran_class class DarkEnergyPPF(DarkEnergyEqnOfState): diff --git a/docs/CAMBdemo.ipynb b/docs/CAMBdemo.ipynb index d23ce98c..be3967ae 100644 --- a/docs/CAMBdemo.ipynb +++ b/docs/CAMBdemo.ipynb @@ -18,7 +18,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "Using CAMB 1.5.1 installed at c:\\work\\dist\\git\\camb\\camb\n" + "Using CAMB 1.5.2 installed at c:\\work\\dist\\git\\camb\\camb\n" ] } ], @@ -1292,7 +1292,7 @@ "for z in zplot:\n", " plt.loglog(k, PK.P(z,k))\n", "plt.xlim([1e-4,kmax])\n", - "plt.xlabel('k Mpc')\n", + "plt.xlabel(r'k Mpc')\n", "plt.ylabel('$P_\\Psi\\, Mpc^{-3}$')\n", "plt.legend(['z=%s'%z for z in zplot]);\n" ] @@ -2857,7 +2857,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "C:\\Users\\Antony\\AppData\\Local\\Temp\\ipykernel_29556\\455262666.py:12: UserWarning: Data has no positive values, and therefore cannot be log-scaled.\n", + "C:\\Users\\Antony\\AppData\\Local\\Temp\\ipykernel_30204\\455262666.py:12: UserWarning: Data has no positive values, and therefore cannot be log-scaled.\n", " ax.set_xlim(k[0], k[-1])\n" ] }, diff --git a/fortran/DarkEnergyFluid.f90 b/fortran/DarkEnergyFluid.f90 index d6d50581..cffa6412 100644 --- a/fortran/DarkEnergyFluid.f90 +++ b/fortran/DarkEnergyFluid.f90 @@ -83,7 +83,7 @@ subroutine TDarkEnergyFluid_Init(this, State) this%num_perturb_equations = 0 else if (this%use_tabulated_w) then - if (any(this%equation_of_state%F<-1)) & + if (any(this%equation_of_state%F<-1) .and. any(this%equation_of_state%F>-1)) & error stop 'Fluid dark energy model does not allow w crossing -1' elseif (this%wa/=0 .and. & ((1+this%w_lam < -1.e-6_dl) .or. 1+this%w_lam + this%wa < -1.e-6_dl)) then diff --git a/fortran/config.f90 b/fortran/config.f90 index 742b6a4b..a99c25bf 100644 --- a/fortran/config.f90 +++ b/fortran/config.f90 @@ -3,7 +3,7 @@ module config use constants, only: const_twopi implicit none - character(LEN=*), parameter :: version = '1.5.2' + character(LEN=*), parameter :: version = '1.5.3' integer :: FeedbackLevel = 0 !if >0 print out useful information about the model