Conversation
|
To update the thread, if a number is returned from |
damonge
left a comment
There was a problem hiding this comment.
OK, for now just one comment on the new stuff you've introduced. I'll get back to normprof now
|
Just to update the thread, we took a part of this discussion to Slack and agreed that the proposed code would introduce a lot of complexity for little benefit. However, I stand by the argument that all template methods in @damonge I did a great deal of simplification, removing all of the added lines (there are no net extra lines of code now). |
damonge
left a comment
There was a problem hiding this comment.
Something must have gone wrong when porting the __eq_attrs__. One other comment too. Then we're done.
damonge
left a comment
There was a problem hiding this comment.
Happy to merge if tests pass.
* first commit * enclose classmethods in the class * brought in minor improvements to halos * coverage
* halo profiles in their own directory * concentrations in their own directory * mass functions & halo biases in their own directory * moved CIB stuff to profiles & 2pts * split halo model into 1/2/4-pt * fix imports * remove empty module * fix typo * Baryons in v3 (#1039) * Added new baryons module that will deprecate old BCM * Tracers v3 (#1040) * Tracers in V3 * Background, boltzmann, and cls in v3 (#1041) * Background, boltzmann and cls in v3 * Covariances in v3 (#1046) * Covariances in V3 * Correlations v3 (#1042) * Correlations in v3 * split base.py and restructured into its own dir to simplify * Neutrinos, parameters, power in v3 (#1047) * done * Make `T_ncdm` a cosmological parameter + (v3) (#1049) * first commit * rename TNCDM to T_ncdm but preserve API * T_CMB directly into cosmo struct * Omega_g in ccl_parameters_create; no split between C/Python * physical_constants.T_CMB doesn't mutate anymore! * force mutate T_CMB in benchmarks * define defaults on instantiation just in case constants mutate * A_s & sigma8: don't play with numbers * simplify * remove leftover mallocs * temporarily preserve API for CCLv3 * Unfreeze option for `physical_constants` (#1050) * first commit * update rtd * addressed comments 1 * Remove `T_CMB` and `T_ncdm` as constants (reloaded) (#1058) * first commit * OmNuh2 fix * addressed comments * keep only massive * first step * temp commit * debug neutrinos & deprecate Omnuh2 * ccl_omega_x & ccl_Omeganuh2 consistency --------- Co-authored-by: David Alonso <dam.phys@gmail.com> * RTD: Removed The Docs --------- Co-authored-by: David Alonso <dam.phys@gmail.com> * flaked --------- Co-authored-by: Nick Koukoufilippas <nikfilippas@gmail.com> * Pk2D and Tk3D in v3 (#1048) * tk3d and pk2d in v3 --------- Co-authored-by: Nick Koukoufilippas <nikfilippas@gmail.com> * PT biases in v3 (#1056) * New PT bias framework * Halos v3 (#1043) * ported changes in halos/profiles * changes from star in halos/ (no tests) * refactor concentration, mass_function, halo_bias; improvements in HMCalculator * HaloProfile subclasses & HaloProfile.normprof attribute * simplify imports * remove HaloProfile.name * cleaned up pk_Npt * add extrap_pk argument * FFTLogParams class instead of dictionary in HaloProfile * simplified code * removed mass_def from HMIngredients; comprehensive code review 1 * re-implementation, bugfixes, tests * c_m_relation >> concentration; code improvements; A_SPLINE_MAX in Python * HMIngredients initializers - no repeated code * rogue file * patch for new changes * updated Build Status badge website * fix websites * added a DOI badge & links * added nonbreaking space * removed extra space * FancyRepr out of CCLObject to simplify * update tests to match changes * coverage * simple test for tkkssc * more tests for tkkssc * addressed comments 1 * addressed comments 2: mass_def defaults are name strings etc. * deprecate Gaussian & PowerLaw profiles * bugfix in master: sometimes mass_def_strict=False fails unexpectedly * typo * addressed comments * New feature: Arbitrary function for profile normalization * gain efficiency * comments + deprecate k_min from HMCalculator * renamed initialize_from_input --> create_instance * brought in CCLNamedClass from docs_v3 * brought in from docs_v3: directly callable HMIngredients * prep for Davids input * renamed HMCalculator --> HaloModel * fix typo * brought in from docs_v3: initialize mass_def from any string (e.g. 400c) * Revert "renamed HMCalculator --> HaloModel" This reverts commit 43591ce. * counterterms func inside of 4pt func * replace deprecated abstractproperty * abstract linked methods for HaloProfile, MassFunc, HaloBias, Concentration * fully working implementation * renamed lM --> log10M etc. * minor cosmetic fix * alternative way to include linked abstract methods and declare the template methods * reorder * even simpler * bring back eq_attrs * r -> r_t * Additional halos features (#1068) * first commit * enclose classmethods in the class * brought in minor improvements to halos * coverage * Tests v3 (#1059) * ported changes in halos/profiles * changes from star in halos/ (no tests) * refactor concentration, mass_function, halo_bias; improvements in HMCalculator * HaloProfile subclasses & HaloProfile.normprof attribute * simplify imports * remove HaloProfile.name * cleaned up pk_Npt * add extrap_pk argument * FFTLogParams class instead of dictionary in HaloProfile * simplified code * removed mass_def from HMIngredients; comprehensive code review 1 * re-implementation, bugfixes, tests * c_m_relation >> concentration; code improvements; A_SPLINE_MAX in Python * HMIngredients initializers - no repeated code * rogue file * patch for new changes * updated Build Status badge website * fix websites * added a DOI badge & links * added nonbreaking space * removed extra space * FancyRepr out of CCLObject to simplify * update tests to match changes * coverage * simple test for tkkssc * more tests for tkkssc * addressed comments 1 * addressed comments 2: mass_def defaults are name strings etc. * deprecate Gaussian & PowerLaw profiles * remove all warnings in testing * use pytest as per docs instead of numpy.testing and pyutils.assert_warns * bugfix in master: sometimes mass_def_strict=False fails unexpectedly * typo * addressed comments * New feature: Arbitrary function for profile normalization * gain efficiency * comments + deprecate k_min from HMCalculator * renamed initialize_from_input --> create_instance * brought in CCLNamedClass from docs_v3 * brought in from docs_v3: directly callable HMIngredients * prep for Davids input * renamed HMCalculator --> HaloModel * fix typo * brought in from docs_v3: initialize mass_def from any string (e.g. 400c) * Revert "renamed HMCalculator --> HaloModel" This reverts commit 43591ce. * comments * comments * shortcut for __eq__ methods * Eq. for EulerianPT calculator (#1073) * __eq_attrs__ for nl_pt * No normprof (#1072) * extricated normprof * Cosmology v3 (#1071) * rename core --> Cosmology * renamed core --> cosmology in docs/imports except docstrings * cosmology v2 * first pass * neutrinosneutrinosneutrinos * simplified * yamlyamlyaml * fully fix neutrino mayhem * new arg names in tests * comments * comments on comments on comments * removed tests * no warn --------- Co-authored-by: David Alonso <dam.phys@gmail.com> * avoid warning due to zeros (#1076) * Fix halo inconsistencies v3 (#1069) * ported changes in halos/profiles * changes from star in halos/ (no tests) * refactor concentration, mass_function, halo_bias; improvements in HMCalculator * HaloProfile subclasses & HaloProfile.normprof attribute * simplify imports * remove HaloProfile.name * cleaned up pk_Npt * add extrap_pk argument * FFTLogParams class instead of dictionary in HaloProfile * simplified code * removed mass_def from HMIngredients; comprehensive code review 1 * re-implementation, bugfixes, tests * c_m_relation >> concentration; code improvements; A_SPLINE_MAX in Python * HMIngredients initializers - no repeated code * rogue file * patch for new changes * updated Build Status badge website * fix websites * added a DOI badge & links * added nonbreaking space * removed extra space * FancyRepr out of CCLObject to simplify * update tests to match changes * coverage * simple test for tkkssc * more tests for tkkssc * addressed comments 1 * addressed comments 2: mass_def defaults are name strings etc. * deprecate Gaussian & PowerLaw profiles * bugfix in master: sometimes mass_def_strict=False fails unexpectedly * typo * addressed comments * New feature: Arbitrary function for profile normalization * gain efficiency * comments + deprecate k_min from HMCalculator * renamed initialize_from_input --> create_instance * brought in CCLNamedClass from docs_v3 * brought in from docs_v3: directly callable HMIngredients * prep for Davids input * renamed HMCalculator --> HaloModel * fix typo * brought in from docs_v3: initialize mass_def from any string (e.g. 400c) * Revert "renamed HMCalculator --> HaloModel" This reverts commit 43591ce. * counterterms func inside of 4pt func * replace deprecated abstractproperty * abstract linked methods for HaloProfile, MassFunc, HaloBias, Concentration * fully working implementation * renamed lM --> log10M etc. * minor cosmetic fix * first commit * alternative way to include linked abstract methods and declare the template methods * reorder * even simpler * enclose classmethods in the class * brought in minor improvements to halos * clone of 1064 * bring back eq_attrs * r -> r_t * Additional halos features (#1068) * first commit * enclose classmethods in the class * brought in minor improvements to halos * coverage * removed MassConcentration * full implementation (v3 only) * comments * single-liner * coverage * Final checklist v3 (#1075) * imports * homogenize all imports as per PEP8 and the Python Import System * homogenize all imports as per PEP8 and the Python Import System * instance checks * all exceptions raised correctly * comments * add aliases * reverted changes and introduced proper enums * Preserve API in v2.final (#1077) * first commit * Einasto mass translator + MassDef concentration API * universal api no-break * comments * MassDef vars * Coverage v3 (#1078) * coverage * comments --------- Co-authored-by: David Alonso <dam.phys@gmail.com>
This PR modifies the
halos/sub-package in line with the v3 mind map.star: (i) KWO arguments, (ii) reordered arguments, (iii) renamed arguments, (iv) renamed attributes.star: deprecation warnings for unused functions (e.g.mass_function_from_name).star: halo tests, once @damonge reviews and agrees with new variable names (i.e. remove warnings). (Tests v3 #1059 )HaloProfileNumberCounts,HaloProfileMatter,HaloProfilePressure,HaloProfileCIB.Makenormprof&is_number_countsaHaloProfileclass attribute in a separate subclass.is_number_countschecks withisinstance(prof, HaloProfileNumberCounts).normprofto__repr_attrs__(and__eq_attrs__after Implement separate__eq__methods #1033 ).extrap_pkso we don't do silent extrapolation in the internal power spectra ofpk_2pt/pk_4pt.mass_defin methods of halo model ingredients: use the one defined at instantiation. (Note: API breakage for now, but will re-instate it for v2.last)HaloProfileGaussianandHaloProfilePowerLawas they are no realHaloProfileimplementations.MassFunc,HaloBias, andConcentrationwith a common superclass to get rid of code repetition.pk_1pt,pk_4pt.__init__.pyto specifying__all__in individual files to have better control of what is imported.Make(bad idea, too complicated for little benefit bcpk_Nptfunctions instances ofHMCalculator.hmcis 2nd arg)Most profiles are of the general form(decided to drop this after all)x = r / Rs. We can probably refactor all of that.halos/pk_4pt.Also fixes the badges on


README.mdfrom thisto this
Other changes:
normprof(only implemented above) in favor of arbitrary profile normalization functions.@templatemethoddecorator for template methods inHaloProfilewhich do not pass the implementation checks.@abstractlinkedmethoddecorator for linked abstract methods inHaloProfile,MassFunc,HaloBias,Concentration.HMIngredients:MassFunc,HaloBias,Concentration& deprecate getter methods.CCLNamedClassfor particular subclasses implementing models with names.from_namefunctionality forCCLNamedClasses withcreate_instanceso that the object is directly constructed.MassDeffrom any string, and pass strings to allHMIngredients:MassFunc,HaloBias,Concentration.mass_def_strictif no universal model implementation exists (e.g.MassFuncBocquet16which so far raised with an unhelpful msg).CCLObjectsuntil v3 because it was a breaking change we originally made.