Skip to content

Commit

Permalink
Add erg, dyne units and Boltzmann constant (#28)
Browse files Browse the repository at this point in the history
* Update copyright statements to 2021

* Add units erg, dyne

* Add Boltzmann constant

* Doc
  • Loading branch information
eduardo-rodrigues authored Feb 16, 2021
1 parent 59fcb24 commit c559d7b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018-2020, Eduardo Rodrigues.
Copyright (c) 2018-2021, Eduardo Rodrigues.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
5 changes: 4 additions & 1 deletion src/hepunits/constants/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from math import pi

from ..units.units import m, s, eplus, mole, joule
from ..units.units import m, s, eplus, mole, joule, kelvin

# -----------------------------------------------------------------------------
# Mathematical constants
Expand Down Expand Up @@ -49,3 +49,6 @@
hbarc = hbar_Planck * c_light

hbarc_sq = hbarc * hbarc

# Boltzmann constant (exact value, taken from PDG 2020)
k_Boltzmann = 1.380649e-23 * joule / kelvin
6 changes: 6 additions & 0 deletions src/hepunits/units/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,14 @@

electronvolt = _pre.micro * megaelectronvolt

zettaelectronvolt = _pre.zetta * electronvolt
exaelectronvolt = _pre.exa * electronvolt
petaelectronvolt = _pre.peta * electronvolt
teraelectronvolt = _pre.tera * electronvolt
gigaelectronvolt = _pre.giga * electronvolt
kiloelectronvolt = _pre.kilo * electronvolt

ZeV = zettaelectronvolt
EeV = exaelectronvolt
PeV = petaelectronvolt
TeV = teraelectronvolt
Expand Down Expand Up @@ -276,6 +278,8 @@

J = joule

erg = 1.0e-7 * joule

# Power [M][L^2][T^-3]
watt = joule / second

Expand All @@ -290,6 +294,8 @@

N = newton

dyne = 1.0e-5 * newton

# Pressure
pascal = newton / meter2

Expand Down

0 comments on commit c559d7b

Please sign in to comment.