import logging
from pkg_resources import iter_entry_points
from ..experiment import Experiment

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

# Avoid PEP-8 warning, we want this to be importable from this location
Experiment = Experiment

for entry_point in iter_entry_points(group='dallinger.experiments'):
    try:
        globals()[entry_point.name] = entry_point.load()
    except ImportError:
        logger.exception('Could not import registered entry point {}'.format(
            entry_point.name
        ))

import logging
from pkg_resources import iter_entry_points

from ..config import get_config
from ..experiment import Experiment

config = get_config()
config.load()

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

# Avoid PEP-8 warning, we want this to be importable from this location
Experiment = Experiment

for entry_point in iter_entry_points(group='dallinger.experiments'):
    try:
        globals()[entry_point.name] = entry_point.load()
    except ImportError:
        logger.exception('Could not import registered entry point {}'.format(
            entry_point.name
        ))

Load config when loading dallinger.experiments
Load config when loading dallinger.experiments

  import logging
  from pkg_resources import iter_entry_points
+ 
+ from ..config import get_config
  from ..experiment import Experiment
+ 
+ config = get_config()
+ config.load()
  
  logger = logging.getLogger(__name__)
  logger.addHandler(logging.NullHandler())
  
  # Avoid PEP-8 warning, we want this to be importable from this location
  Experiment = Experiment
  
  for entry_point in iter_entry_points(group='dallinger.experiments'):
      try:
          globals()[entry_point.name] = entry_point.load()
      except ImportError:
          logger.exception('Could not import registered entry point {}'.format(
              entry_point.name
          ))
  
Load config when loading dallinger.experiments
## Code Before:
import logging
from pkg_resources import iter_entry_points
from ..experiment import Experiment

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

# Avoid PEP-8 warning, we want this to be importable from this location
Experiment = Experiment

for entry_point in iter_entry_points(group='dallinger.experiments'):
    try:
        globals()[entry_point.name] = entry_point.load()
    except ImportError:
        logger.exception('Could not import registered entry point {}'.format(
            entry_point.name
        ))

## Instruction:
Load config when loading dallinger.experiments
## Code After:
import logging
from pkg_resources import iter_entry_points

from ..config import get_config
from ..experiment import Experiment

config = get_config()
config.load()

logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())

# Avoid PEP-8 warning, we want this to be importable from this location
Experiment = Experiment

for entry_point in iter_entry_points(group='dallinger.experiments'):
    try:
        globals()[entry_point.name] = entry_point.load()
    except ImportError:
        logger.exception('Could not import registered entry point {}'.format(
            entry_point.name
        ))
