Giter Club home page Giter Club logo

Comments (2)

jmd-dk avatar jmd-dk commented on August 16, 2024

Hello @wuchenglon. The different items within Python dictionaries need to be separated by commas (,). You currently have this:

output_times = {
    'snapshot': a_begin
    'render2D': a_begin
}

but need to add a comma like so:

output_times = {
    'snapshot': a_begin,
    'render2D': a_begin
}

(you even see that the syntax highlighting here on GitHub is not happy about the first case).
Since Python allows trailing commas, I recommend adding one more comma:

output_times = {
    'snapshot': a_begin,
    'render2D': a_begin,
}

(this way, you won't forget the comma if you one day add another item/line).

Note that the above is purely about Python syntax, it is not specific to CONCEPT. You have the same issue for output_dirs.

A separate issue is your way of defining H0:

H0 = 67km/(sMpc)

You need to write this as

H0 = 67*km/(s*Mpc)

as 1) Python does not understand things like 67km and 2) CONCEPT only defines individual "basic" units, like s and Mpc, not products like sMpc = s*Mpc.

May I ask whether you've written these parameter definitions out yourself, or have you obtained them from copying code from somewhere (e.g. the documentation)?

from concept.

wuchenglon avatar wuchenglon commented on August 16, 2024

Hello @wuchenglon. The different items within Python dictionaries need to be separated by commas (). You currently have this:,

output_times = {
    'snapshot': a_begin
    'render2D': a_begin
}

but need to add a comma like so:

output_times = {
    'snapshot': a_begin,
    'render2D': a_begin
}

(you even see that the syntax highlighting here on GitHub is not happy about the first case). Since Python allows trailing commas, I recommend adding one more comma:

output_times = {
    'snapshot': a_begin,
    'render2D': a_begin,
}

(this way, you won't forget the comma if you one day add another item/line).

Note that the above is purely about Python syntax, it is not specific to CO_N_CEPT. You have the same issue for .output_dirs

A separate issue is your way of defining :H0

H0 = 67km/(sMpc)

You need to write this as

H0 = 67*km/(s*Mpc)

as 1) Python does not understand things like and 2) CO_N_CEPT only defines individual "basic" units, like and , not products like .67km``s``Mpc``sMpc = s*Mpc

May I ask whether you've written these parameter definitions out yourself, or have you obtained them from copying code from somewhere (e.g. the documentation)?

Hi jmd-dk, thank you for your careful guidance. Indeed I learned and copied code from https://jmd-dk.github.io/concept/ and example_basic from concept/param and it's my fault that lack of inspection, now I get the file what I want.
Thanks again for your generous help.

from concept.

Related Issues (6)

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.