Skip to content

Commit 284793f

Browse files
committed
cleanup of some core files
1 parent 409d3b0 commit 284793f

3 files changed

Lines changed: 238 additions & 191 deletions

File tree

src/amuse/__init__.py

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,49 @@
2525
or (directly from the terminal):
2626
> pydoc amuse.ic
2727
"""
28+
2829
import sys
2930
import os
3031
import numpy
3132

3233
_AMUSE_ROOT = os.path.abspath(os.path.dirname(__file__))
3334

35+
3436
def numpy_fix():
3537
try:
36-
numpy.set_printoptions(legacy='1.13')
38+
numpy.set_printoptions(legacy="1.13")
3739
except TypeError:
3840
pass
39-
41+
42+
4043
numpy_fix()
4144

42-
class NoConfig(object):
45+
46+
class NoConfig:
4347
def __init__(self, message):
44-
self._message=message
48+
self._message = message
49+
4550
def __getattr__(self, attr):
4651
raise AttributeError(self._message)
4752

53+
4854
try:
4955
from . import config
50-
except Exception as ex:
51-
message="Configuration not read in - or configuration invalid, exception:\n"+str(ex)
52-
config=NoConfig(message)
56+
except FileNotFoundError as ex:
57+
message = (
58+
"Configuration not read in - or configuration invalid, exception:\n" + str(ex)
59+
)
60+
config = NoConfig(message)
5361

5462

5563
# always report AMUSE reference information
5664
try:
5765
from amuse.support.literature import TrackLiteratureReferences
66+
5867
TrackLiteratureReferences.default()
5968
except:
6069
pass
6170

71+
6272
def get_data(path):
63-
return os.path.join(_AMUSE_ROOT, 'data', path)
73+
return os.path.join(_AMUSE_ROOT, "data", path)

0 commit comments

Comments
 (0)