Git Product home page Git Product logo

Comments (4)

MilesCranmer avatar MilesCranmer commented on June 3, 2024

I didn't add n for grams yet but we can definitely add it. To do this we simply change this line:

@add_prefixes g (μ, u, m, k)

and add n.

If you see the available prefixes:

@add_prefixes m (f, p, n, μ, u, c, d, m, k, M, G)
@add_prefixes g (μ, u, m, k)
@add_prefixes s (f, p, n, μ, u, m)
@add_prefixes A (n, μ, u, m, k)
@add_prefixes K (m,)
@add_prefixes cd (m,)
@add_prefixes mol (m,)

you can see most combinations don't exist – I basically just didn't want to blow up the list of symbols until someone actually has a need for them (e.g., I don't think people use kilosecond (?), so I didn't add ks). But since you do have a need for ng, let's add it!

from dynamicquantities.jl.

jkrumbiegel avatar jkrumbiegel commented on June 3, 2024

We also use picograms, so we could add that, too. kilosecond, I agree, is not common. But in pharmacology, small quantities are pretty common.

This @add_prefixes macro cannot be called dynamically, right? If we had the need for special combinations you don't want to add, would we be fine copying the unit code with our modifications for our own dimensions type? Is that how the system is intended?

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 3, 2024

No, it would have to be internal to the library – @add_prefixes cannot be called later. But I really don't mind adding it! I just wanted to play it by ear and not add units until people asked for them, since I don't know what units are common in which fields.

from dynamicquantities.jl.

MilesCranmer avatar MilesCranmer commented on June 3, 2024

I'm also thinking of ways we could enable libraries to add more units upon loading... I'm not sure if such a strategy is dangerous or not.

from dynamicquantities.jl.

Related Issues (20)

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.