Skip to content

Commit

Permalink
Fix docstrings like break the Sphinx build.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpearce committed Feb 21, 2017
1 parent 8422ef2 commit d3181c8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 31 deletions.
15 changes: 12 additions & 3 deletions scripts/skhep-info
Expand Up @@ -4,19 +4,28 @@
#-----------------------------------------------------------------------------
# Import statements
#-----------------------------------------------------------------------------
from skhep import *
import skhep

#-----------------------------------------------------------------------------
# Print the project information - banner and package information
#-----------------------------------------------------------------------------
_banner = """
_____ _ _ _ _ _ _ ______ _____
/ ____| (_) | (_) | | | | | ____| __ \
| (___ ___ _| | ___| |_ ____ | |__| | |__ | |__) |
\___ \ / __| | |/ / | __| ____ | __ | __| | ___/
____) | (__| | <| | |_ | | | | |____| |
|_____/ \___|_|_|\_\_|\__| |_| |_|______|_| {0}
"""
_default = '\x1b[00m'
_green = '\x1b[32;32m'

print( _green + banner + _default )
print( _green + _banner.format(skhep.__version__) + _default )

_proj_info = """Homepage %s
GitHub %s
PyPI %s
""" % ( project_url, project_url_GitHub, project_url_PyPI )
""" % ( skhep.project_url, skhep.project_url_GitHub, skhep.project_url_PyPI )

print( _proj_info )
7 changes: 0 additions & 7 deletions skhep/__init__.py
@@ -1,12 +1,5 @@
# Licensed under a 3-clause BSD style license, see LICENSE.
"""
_____ _ _ _ _ _ _ ______ _____
/ ____| (_) | (_) | | | | | ____| __ \
| (___ ___ _| | ___| |_ ____ | |__| | |__ | |__) |
\___ \ / __| | |/ / | __| ____ | __ | __| | ___/
____) | (__| | <| | |_ | | | | |____| |
|_____/ \___|_|_|\_\_|\__| |_| |_|______|_| {0}
A community-driven and oriented Python software project for High Energy Physics.
"""

Expand Down
16 changes: 8 additions & 8 deletions skhep/constants/__init__.py
Expand Up @@ -9,14 +9,14 @@
Typical use case::
>>> from skhep.constants import c_light
>>> from skhep.units import picosecond, micrometer
>>> tau_Bs = 1.5 * picosecond # a particle lifetime, say the Bs meson's
>>> ctau_Bs = c_light * tau_Bs # ctau of the particle, roughly 450 microns
>>> print ctau_Bs # result in HEP units, so mm ;-)
0.449688687
>>> print ctau_Bs / micrometer # result in micrometers
449.688687
>>> from skhep.constants import c_light
>>> from skhep.units import picosecond, micrometer
>>> tau_Bs = 1.5 * picosecond # a particle lifetime, say the Bs meson's
>>> ctau_Bs = c_light * tau_Bs # ctau of the particle, roughly 450 microns
>>> print ctau_Bs # result in HEP units, so mm ;-)
0.449688687
>>> print ctau_Bs / micrometer # result in micrometers
449.688687
"""

Expand Down
25 changes: 12 additions & 13 deletions skhep/units/__init__.py
Expand Up @@ -38,19 +38,18 @@
Typical use cases::
>>> # add two quantities with length units and get the result im meters
>>> from skhep import units as u
>>> (1 * u.meter + 5 * u.cm) / u.meter
1.05
>>> from skhep.units import MeV, GeV
>>> massWindow = 100 * MeV # define a 100 MeV mass window
>>> def energy_resolution():
... # returns the energy resolution of 100 MeV
... return 100 * MeV
...
>>> energy_resolution() / GeV # get the energy resolution in GeV
0.1
>>> # add two quantities with length units and get the result im meters
>>> from skhep import units as u
>>> (1 * u.meter + 5 * u.cm) / u.meter
1.05
>>> from skhep.units import MeV, GeV
>>> massWindow = 100 * MeV # define a 100 MeV mass window
>>> def energy_resolution():
... # returns the energy resolution of 100 MeV
... return 100 * MeV
...
>>> energy_resolution() / GeV # get the energy resolution in GeV
0.1
----
Expand Down

0 comments on commit d3181c8

Please sign in to comment.