Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.final #1038

Merged
merged 32 commits into from
May 3, 2023
Merged

v2.final #1038

merged 32 commits into from
May 3, 2023

Conversation

nikfilippas
Copy link
Contributor

@nikfilippas nikfilippas commented Mar 20, 2023

WIP for CCLv3. CCLv3 branches to be based on here. This was originally a clone of master with an internal restructure in halos/ and base/ as specified below:

  • Declutter halos/profiles: each profile in its own module.
  • Declutter halos/concentration: each concentration in its own module.
  • Declutter halos/hmfunc: each mass function in its own module.
  • Declutter halos/hbias: each halo bias in its own module.
  • Declutter halos/halo_model: separate modules for pk_1pt, pk_2pt, pk_4pt.
  • Declutter base.py: split into caching.py, deprecations.py ccl_object.py and moved these under pyccl/base/.

List of things to change:

To remember:

Nick's to-do list, once everything is merged in here: (#1075 )

  • Go through Issues and Milestones and see what can be linked to here. (remaining ones in Docs v3 #1053 )
  • Assert statements in tests only with pytest. (Tests v3 #1059 )
  • Restructure star to new dir-tree, and temporarily rebase v3_wip --> star to check for any leftover things to change.
  • Bring back old tests to see that everything works and API is preserved. (Preserve API in v2.final #1077 )
  • Do a final pass and examine code quality. (Final checklist v3 #1075 )
    • simplify internal imports with __all__ and *
    • if-else return statements
    • return without defining extra variable
    • self._one_over_4_pi replace the like with numbers
    • remove all useless type-checking (type hints where needed to enable use with mypy)
    • methods of cosmology - no import needed

@coveralls
Copy link

coveralls commented Mar 20, 2023

Pull Request Test Coverage Report for Build 4772419445

  • 3782 of 3878 (97.52%) changed or added relevant lines in 75 files are covered.
  • 6 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.6%) to 97.309%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyccl/init.py 30 31 96.77%
pyccl/base/caching.py 162 163 99.39%
pyccl/neutrinos.py 54 55 98.18%
pyccl/nl_pt/ept.py 268 269 99.63%
pyccl/pyutils.py 30 31 96.77%
pyccl/boltzmann.py 6 8 75.0%
pyccl/halos/hbias/sheth99.py 22 25 88.0%
pyccl/tk3d.py 27 30 90.0%
pyccl/halos/pk_4pt.py 154 158 97.47%
pyccl/tracers.py 65 69 94.2%
Files with Coverage Reduction New Missed Lines %
pyccl/covariances.py 1 98.52%
pyccl/pk2d.py 1 97.08%
pyccl/halos/massdef.py 2 91.25%
pyccl/nl_pt/tracers.py 2 97.83%
Totals Coverage Status
Change from base Build 4719431164: -0.6%
Covered Lines: 5823
Relevant Lines: 5984

💛 - Coveralls

Copy link
Collaborator

@damonge damonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one typo

nikfilippas and others added 4 commits March 21, 2023 19:30
* Added new baryons module that will deprecate old BCM
* Tracers in V3
@nikfilippas
Copy link
Contributor Author

nikfilippas commented Mar 24, 2023

Coverage decreased slightly but not to worry, this is largely because we aren't testing warn_api. We can add tests for this at the end. The other lines marked as "new missed" aren't actually new missed. They are flagged because we restructured the code.

damonge added 3 commits March 24, 2023 14:16
* Background, boltzmann and cls in v3
* Covariances in V3
* Correlations in v3
nikfilippas and others added 7 commits March 30, 2023 20:35
* 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>
* tk3d and pk2d in v3

---------

Co-authored-by: Nick Koukoufilippas <nikfilippas@gmail.com>
* New PT bias framework
* 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
* 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
nikfilippas and others added 5 commits April 18, 2023 13:24
* __eq_attrs__ for nl_pt
* extricated normprof
* 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>
@hsinfan1996 hsinfan1996 marked this pull request as ready for review April 21, 2023 13:01
@hsinfan1996 hsinfan1996 marked this pull request as draft April 21, 2023 13:02
* 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
* 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
* first commit

* Einasto mass translator + MassDef concentration API

* universal api no-break

* comments

* MassDef vars
@nikfilippas nikfilippas changed the title v3 v2.final Apr 22, 2023
* coverage

* comments
@damonge damonge marked this pull request as ready for review May 3, 2023 07:57
Copy link
Collaborator

@damonge damonge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging to master after last pure v2 release

@damonge damonge merged commit f81b59a into master May 3, 2023
@damonge damonge deleted the v3_wip branch May 3, 2023 08:01
@damonge damonge restored the v3_wip branch May 3, 2023 10:30
@damonge damonge deleted the v3_wip branch May 3, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistencies in function arguments Star operator for keyword-only arguments
3 participants