-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add versioneer * Remove unnecessary try/catch in __init__.py - Version is no longer obtained by importing from __init__.py
- Loading branch information
1 parent
76a689a
commit 94c1283
Showing
7 changed files
with
2,380 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Added by versioneer | ||
euphonic/_version.py export-subst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
include c/*.h | ||
include versioneer.py | ||
include euphonic/_version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
__version__ = '0.2.2' | ||
from ._version import get_versions | ||
__version__ = get_versions()['version'] | ||
del get_versions | ||
|
||
try: | ||
# Create ureg here so it is only created once. However, this | ||
# __init__.py needs to be imported by setup.py to find __version__, | ||
# so allow pint import to fail as in this case pint might not be | ||
# installed yet | ||
from pint import UnitRegistry | ||
ureg = UnitRegistry() | ||
ureg.enable_contexts('spectroscopy') | ||
ureg.define('@alias bohr = INTERNAL_LENGTH_UNIT') | ||
ureg.define('@alias electron_mass = INTERNAL_MASS_UNIT') | ||
ureg.define('@alias hartree = INTERNAL_ENERGY_UNIT') | ||
ureg.define('@alias elementary_charge = INTERNAL_CHARGE_UNIT') | ||
ureg.define('@alias K = INTERNAL_TEMPERATURE_UNIT') | ||
# Create ureg here so it is only created once | ||
from pint import UnitRegistry | ||
ureg = UnitRegistry() | ||
ureg.enable_contexts('spectroscopy') | ||
ureg.define('@alias bohr = INTERNAL_LENGTH_UNIT') | ||
ureg.define('@alias electron_mass = INTERNAL_MASS_UNIT') | ||
ureg.define('@alias hartree = INTERNAL_ENERGY_UNIT') | ||
ureg.define('@alias elementary_charge = INTERNAL_CHARGE_UNIT') | ||
ureg.define('@alias K = INTERNAL_TEMPERATURE_UNIT') | ||
|
||
ureg.define('@alias angstrom = DEFAULT_LENGTH_UNIT') | ||
ureg.define('@alias amu = DEFAULT_MASS_UNIT') | ||
ureg.define('@alias eV = DEFAULT_ENERGY_UNIT') | ||
ureg.define('@alias K = DEFAULT_TEMPERATURE_UNIT') | ||
ureg.define('@alias angstrom = DEFAULT_LENGTH_UNIT') | ||
ureg.define('@alias amu = DEFAULT_MASS_UNIT') | ||
ureg.define('@alias eV = DEFAULT_ENERGY_UNIT') | ||
ureg.define('@alias K = DEFAULT_TEMPERATURE_UNIT') | ||
|
||
from .spectra import Spectrum1D, Spectrum2D | ||
from .crystal import Crystal | ||
from .debye_waller import DebyeWaller | ||
from .structure_factor import StructureFactor | ||
from .qpoint_phonon_modes import QpointPhononModes | ||
from .force_constants import ForceConstants | ||
except ImportError: | ||
pass | ||
from .spectra import Spectrum1D, Spectrum2D | ||
from .crystal import Crystal | ||
from .debye_waller import DebyeWaller | ||
from .structure_factor import StructureFactor | ||
from .qpoint_phonon_modes import QpointPhononModes | ||
from .force_constants import ForceConstants |
Oops, something went wrong.