Skip to content

Commit

Permalink
removing sandy/core (#350)
Browse files Browse the repository at this point in the history
* records.py

* lpc.py

* cov.py

* endf6.py

* xs.py

* Delete sandy/core/

* polishing

* Docstring edistr.py

* docsting xs.py

* docsting samples.py

* docsting fy.py

* docsting endf6.py

* docsting errorr.py

* gendef.py inport

* update

---------

Co-authored-by: Luca Fiorito <lfiorito@sckcen.be>
  • Loading branch information
GrimFe and Luca Fiorito authored Sep 5, 2024
1 parent 56e266a commit d86aa4d
Show file tree
Hide file tree
Showing 17 changed files with 1,376 additions and 1,577 deletions.
148 changes: 76 additions & 72 deletions sandy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,72 +1,76 @@
import logging
import sys

from .settings import *
from .constants import *
from .decay import *
from .energy_grids import *
from .errorr import *
from .gendf import *
from .fy import *
from .tsl import *
from .gls import *
from .libraries import *
from .pert import *
from .edistr import *
from sandy.zam import *
from .njoy import *
from .sections import *
from .shared import *
from .utils import *
from .core import *
# from .sampling import * # don't do this
from .spectra import *

import sandy.mcnp
import sandy.aleph2
import sandy.tools
import sandy.shared
import sandy.sampling

from .samples import *

testdir = "tests"


class ShutdownHandler(logging.Handler):
"""
Trigger exit on errors.
"""

def emit(self, record):
logging.shutdown()
sys.exit(1)


class DuplicateFilter(object):
"""
Define a filter which keeps track of what was logged, and attach it to
your logger for the duration of a loop.
"""

def __init__(self):
self.msgs = set()

def filter(self, record):
rv = record.msg not in self.msgs
self.msgs.add(record.msg)
return rv


class Error(Exception):
pass


FORMAT = '%(levelname)s: %(message)s'
logging.basicConfig(format=FORMAT)
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(ShutdownHandler(level=40))
# logging.getLogger().addFilter(DuplicateFilter())


__version__ = '1.1b1'
import logging
import sys

testdir = "tests"


class ShutdownHandler(logging.Handler):
"""
Trigger exit on errors.
"""

def emit(self, record):
logging.shutdown()
sys.exit(1)


class DuplicateFilter(object):
"""
Define a filter which keeps track of what was logged, and attach it to
your logger for the duration of a loop.
"""

def __init__(self):
self.msgs = set()

def filter(self, record):
rv = record.msg not in self.msgs
self.msgs.add(record.msg)
return rv


class Error(Exception):
pass


FORMAT = '%(levelname)s: %(message)s'
logging.basicConfig(format=FORMAT)
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(ShutdownHandler(level=40))
# logging.getLogger().addFilter(DuplicateFilter())


__version__ = '1.1b1'


# Must import submodules after __version__ and everything above.
from .constants import *
from .cov import *
from .decay import *
from .endf6 import *
from .energy_grids import *
from .errorr import *
from .fy import *
from .gendf import *
from .gls import *
from .libraries import *
from .lpc import *
from .pert import *
from .edistr import *
from .njoy import *
from .records import *
from .samples import *
from .sections import *
from .settings import *
from .shared import *
from .tools import *
from .tsl import *
from .utils import *
from .zam import *
from .sampling import *
from .spectra import *
from .xs import *

# These are folders
from . import mcnp
from . import aleph2
5 changes: 0 additions & 5 deletions sandy/core/__init__.py

This file was deleted.

182 changes: 0 additions & 182 deletions sandy/core/classes_core.html

This file was deleted.

43 changes: 0 additions & 43 deletions sandy/core/packages_core.html

This file was deleted.

Loading

0 comments on commit d86aa4d

Please sign in to comment.