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

closes #98 #182

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion stochss_compute/client/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from abc import ABC, abstractmethod
import requests
from stochss_compute.client.endpoint import Endpoint
from stochss_compute.core.messages import Request, Response
from stochss_compute.core.messages.base import Request

class Server(ABC):
'''
Expand Down
2 changes: 1 addition & 1 deletion stochss_compute/cloud/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from secrets import token_hex
from stochss_compute.client.server import Server
from stochss_compute.cloud.ec2_config import EC2LocalConfig, EC2RemoteConfig
from stochss_compute.core.messages import SourceIpRequest, SourceIpResponse
from stochss_compute.core.messages.source_ip import SourceIpRequest, SourceIpResponse
from stochss_compute.cloud.exceptions import EC2ImportException, ResourceException, EC2Exception
from stochss_compute.client.endpoint import Endpoint
try:
Expand Down
24 changes: 24 additions & 0 deletions stochss_compute/core/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'''
stochss_compute.core.exceptions
'''
# StochSS-Compute is a tool for running and caching GillesPy2 simulations remotely.
# Copyright (C) 2019-2023 GillesPy2 and StochSS developers.

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

class PRNGCollision(Exception):
'''
...Lucky???
'''

36 changes: 36 additions & 0 deletions stochss_compute/core/log_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
'''
stochss_compute.core.log_config

Global Logging Configuration
'''

from logging import getLogger

def init_logging(name):
'''
Call after import to initialize logs in a module file.
To follow convention, use predefined __name__.

Like so:

from stochss_compute.core.log_config import init_logs
log = init_logs(__name__)

:param name: Name for the logger. Use the dot-separated module path string.
:type name: str

:returns: A module specific logger.
:rtype: logging.Logger
'''
logger = getLogger(name)
return logger

def set_global_log_level(level):
'''
Sets the root logger log level.

:param level: NOTSET:0, DEBUG:10, INFO:20, WARNING:30, ERROR:40, CRITICAL:50, etc.
:type level: int | logging._Level
'''
getLogger(__name__.split('.', maxsplit=1)[0]).setLevel(level)