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

Add deprecation warning for the CobaltProvider #3101

Merged
merged 1 commit into from
Feb 23, 2024
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
6 changes: 6 additions & 0 deletions parsl/providers/cobalt/cobalt.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import time
import warnings

from parsl.providers.errors import ScaleOutFailed
from parsl.channels import LocalChannel
Expand All @@ -24,6 +25,8 @@
class CobaltProvider(ClusterProvider, RepresentationMixin):
""" Cobalt Execution Provider

WARNING: CobaltProvider is deprecated and will be removed by 2024.04

This provider uses cobalt to submit (qsub), obtain the status of (qstat), and cancel (qdel)
jobs. Theo script to be used is created from a template file in this
same module.
Expand Down Expand Up @@ -86,6 +89,9 @@ def __init__(self,
self.queue = queue
self.scheduler_options = scheduler_options
self.worker_init = worker_init
warnings.warn("CobaltProvider is deprecated; This will be removed after 2024-04",
DeprecationWarning,
stacklevel=2)

def _status(self):
"""Returns the status list for a list of job_ids
Expand Down
16 changes: 16 additions & 0 deletions parsl/tests/test_providers/test_cobalt_deprecation_warning.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import warnings
import pytest
from parsl.providers import CobaltProvider


@pytest.mark.local
def test_deprecation_warning():

with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always")

CobaltProvider()

assert len(w) == 1
assert issubclass(w[-1].category, DeprecationWarning)
assert "CobaltProvider" in str(w[-1].message)
Loading