GithubHelp home page GithubHelp logo

cosmo's People

Contributors

sbinet avatar wmwv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cosmo's Issues

Test performance

Add performance benchmarks

  1. Luminosity distance calculations and inverse E(z) function.
  2. Measure performance
  3. Determine if there are performance gains of more directly rewriting inverse E(z)
  4. Measure if the stacking of function calls creates performance slowdown
  5. Determine if E(z) should use an if or switch statement to avoid the math.Sinh calculation for Omega_curvature = 0.
  6. Implement any performance gains above.

Remove unused Tcmb0

Current types don't actually do anything with Tcmb0.

  1. Remove this attributes from the types FlatLCDM, LambdaCDM, WCDM, and WACDM.
  2. Remove the zero-setting struct initializations from the tests and examples.

Remove Evec code.

There is some code in to vectorize Evec calculations, but there's not a clear use model informing the design. The Evec function is not otherwise used internally.

Remove Evec functions and associated tests.

Add Ok0() method

Want to be able to interrogate FLRW types about their flatness in a generic way.

Could imagine having a generic Getter framework, but let's restrict this issue to just Ok0().

[No Setters in any case as the cosmology structs should be immutable.]

Make number of integration points in quad.Fixed call an argument with a default.

Make the quad.Fixed-calling functions:

func (cos *Cosmology) ComovingDistanceZ1Z2Integrate(z1, z2 float64) (distance float64)
func (cos *Cosmology) LookbackTimeIntegrate(z float64) (time float64)
func (cos *Cosmology) AgeIntegrate(z float64) (time float64)

accept an argument specifying the number of integration points.

This isn't particularly likely to be used, and it would be better to instead specify relative or absolute tolerance, but having n hardcoded is worse.

Check and correct test cases for wcdm_test, wacdm_test

Check and correct test cases for wcdm_test, wacdm_test

  1. Several of the tests appear to have been calculated with w0=-1 instead of w0=-1.2. Use astropy.cosmology.wCDM, w0waCDM to correct the expected values.
  2. Check wcdm_test.go
  3. Check wacdm_test.go
  4. Correct the errors in the implementation that lead to those tests currently passing.

Change argument order to put H0 first.

All cosmologies need H0, then Om0, then Ol0, then W0, then WA.

Reorder struct attributes to put H0 to match this so that one can have

EdS(H0)
FlatLCDM(H0, Om0)
LambdaCDM(H0, Om0, Ol0)
WCDM(H0, Om0, Ol0, W0)
WACDM(H0, Om0, Ol0, W0, WA)

Note that EdS doesn't current exist as a type listing it here captures the point of why there's a certain natural order to the arguments.

Shift table-based tests to struct with name, cos, exp

  1. Include the cosmological parameters in the table-drive tests.
  2. Use these to create truly table-driven tests. Where the map is iterated over instead of having specific functions for each test.

E.g., the current test says this:

var answersWCDM = map[string][]float64{
	//   wCDM(70, 0.3, 0.7, -1.2).distmod(z)
	"WCDMDistanceModulus":           []float64{42.32710911, 44.17957201, 46.03118144, 47.09228735},
	//   wCDM(70, 0.3, 0.7, -1.1).luminosity_distance(z)
	"WCDMLuminosityDistanceFlat": []float64{2877.10314183, 6734.38177991, 15823.59621899, 25841.56448508},
}

Change to something more like

var answersWCDM = []struct {
    H0 float64
    Om0 float64
    Ol0 float64
    W0 float64
    name string
    out float64
}{
	//   wCDM(70, 0.3, 0.7, -1.2).distmod(z)
	{70, 0.3, 0.7, -1.2, "WCDMDistanceModulus", []float64{42.32710911, 44.17957201, 46.03118144, 47.09228735}},
	//   wCDM(70, 0.3, 0.7, -1.1).luminosity_distance(z)
	{70, 0.3, 0.7, -1.1, "WCDMLuminosityDistanceFlat", []float64{2877.10314183, 6734.38177991, 15823.59621899, 25841.56448508},
}

Increase testing by rewriting test runner

  1. Wrap tests in test runner functions to create a clearer table-driven approach.
  2. Expand number of cosmological parameter regimes tested using new table-driven format.

Rename `Cosmology` interface to `FLRW`.

Rename Cosmology interface to FLRW. That's more specifically the interface that the methods have to fine. And the name of the package cosmo already captures that part of the name.

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.