Skip to content

Commit

Permalink
Merge pull request #341 from pyiron/rename
Browse files Browse the repository at this point in the history
Rename classes to QueueAdapterCore and QueueAdapterWithConfig
  • Loading branch information
jan-janssen authored Sep 28, 2024
2 parents a0470e1 + cbbcb18 commit 93f52f7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pysqa/ext/modular.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import pandas

from pysqa.utils.basic import BasisQueueAdapter
from pysqa.utils.basic import QueueAdapterWithConfig
from pysqa.utils.execute import execute_command


class ModularQueueAdapter(BasisQueueAdapter):
class ModularQueueAdapter(QueueAdapterWithConfig):
"""
A class representing a modular queue adapter.
Expand Down
4 changes: 2 additions & 2 deletions pysqa/ext/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import paramiko
from tqdm import tqdm

from pysqa.utils.basic import BasisQueueAdapter
from pysqa.utils.basic import QueueAdapterWithConfig
from pysqa.utils.execute import execute_command


class RemoteQueueAdapter(BasisQueueAdapter):
class RemoteQueueAdapter(QueueAdapterWithConfig):
"""
A class representing a remote queue adapter.
Expand Down
4 changes: 2 additions & 2 deletions pysqa/queueadapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas

from pysqa.ext.modular import ModularQueueAdapter
from pysqa.utils.basic import BasisQueueAdapter
from pysqa.utils.basic import QueueAdapterWithConfig
from pysqa.utils.config import read_config
from pysqa.utils.execute import execute_command

Expand Down Expand Up @@ -351,7 +351,7 @@ def set_queue_adapter(
directory (str): directory which contains the queue configurations
"""
if config["queue_type"] in ["SGE", "TORQUE", "SLURM", "LSF", "MOAB", "FLUX"]:
return BasisQueueAdapter(
return QueueAdapterWithConfig(
config=config, directory=directory, execute_command=execute_command
)
elif config["queue_type"] in ["GENT"]:
Expand Down
4 changes: 2 additions & 2 deletions pysqa/utils/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from jinja2 import Template
from jinja2.exceptions import TemplateSyntaxError

from pysqa.utils.core import CoreQueueAdapter
from pysqa.utils.core import QueueAdapterCore
from pysqa.utils.execute import execute_command
from pysqa.utils.queues import Queues
from pysqa.utils.validate import value_error_if_none, value_in_range


class BasisQueueAdapter(CoreQueueAdapter):
class QueueAdapterWithConfig(QueueAdapterCore):
"""
The goal of the QueueAdapter class is to make submitting to a queue system as easy as starting another sub process
locally.
Expand Down
2 changes: 1 addition & 1 deletion pysqa/utils/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_queue_commands(queue_type: str) -> Union[SchedulerCommands, None]:
)


class CoreQueueAdapter(object):
class QueueAdapterCore(object):
"""
The goal of the QueueAdapter class is to make submitting to a queue system as easy as starting another sub process
locally.
Expand Down
4 changes: 2 additions & 2 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest
from jinja2.exceptions import TemplateSyntaxError
from pysqa import QueueAdapter
from pysqa.utils.basic import BasisQueueAdapter
from pysqa.utils.basic import QueueAdapterWithConfig
from pysqa.utils.validate import value_in_range

__author__ = "Jan Janssen"
Expand Down Expand Up @@ -34,7 +34,7 @@ def test_bad_queue_template(self):
class TestBasisQueueAdapter(unittest.TestCase):
def test_bad_queue_type(self):
with self.assertRaises(ValueError):
BasisQueueAdapter(config={"queue_type": "error", "queues": {}})
QueueAdapterWithConfig(config={"queue_type": "error", "queues": {}})

def test_memory_string_comparison(self):
self.assertEqual(value_in_range(1023, value_min="1K"), "1K")
Expand Down

0 comments on commit 93f52f7

Please sign in to comment.