Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate CPUEnvironment and GPUEnvironment #381

Merged
merged 3 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Added
Changed
+++++++
- Command line interface for ``exec`` changed parameter name from ``jobid`` to ``job_id`` (#363).

- ``CPUEnvironment`` and ``GPUEnvironment`` classes are deprecated (#381).

Version 0.11
============
Expand Down
15 changes: 4 additions & 11 deletions flow/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
environment, e.g. for the adjustment of scheduler submission scripts.
"""
import importlib
import importlib.machinery
import logging
import os
import re
import socket
from collections import OrderedDict

from deprecation import deprecated
from signac.common import config

from .directives import (
Expand All @@ -37,6 +37,7 @@
from .scheduling.slurm import SlurmScheduler
from .scheduling.torque import TorqueScheduler
from .util import config as flow_config
from .version import __version__

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -418,26 +419,18 @@ def add_args(cls, parser):
)


@deprecated(deprecated_in="0.12", removed_in="0.14", current_version=__version__)
class CPUEnvironment(ComputeEnvironment):
"An environment with CPUs."
pass


@deprecated(deprecated_in="0.12", removed_in="0.14", current_version=__version__)
class GPUEnvironment(ComputeEnvironment):
"An environment with GPUs."
pass


def _import_module(fn):
return importlib.machinery.SourceFileLoader(fn, fn).load_module()


def _import_modules(prefix):
for fn in os.path.listdir(prefix):
if os.path.isfile(fn) and os.path.splitext(fn)[1] == ".py":
_import_module(os.path.join(prefix, fn))


def _import_configured_environments():
cfg = config.load_config(config.FN_CONFIG)
try:
Expand Down