Skip to content

Commit

Permalink
fix: Remove dev_enabled and viz_enabled, use GitHub default python gi…
Browse files Browse the repository at this point in the history
…tignore, remove multiline f-string
  • Loading branch information
dragonejt committed Jun 21, 2024
1 parent 0ca55e7 commit 9eb12bd
Show file tree
Hide file tree
Showing 5 changed files with 169 additions and 57 deletions.
133 changes: 130 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,132 @@
*.pyc
.DS_Store
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.vscode/
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Visual Studio Code
.vscode/
2 changes: 1 addition & 1 deletion onair/config/default_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PlannersPluginDict = {'generic':'plugins/generic/__init__.py'}
# Required Key: ComplexPluginDict(s) are used by Agent for complex reasoning
ComplexPluginDict = {'generic':'plugins/generic/__init__.py'}

# Required Section: OPTIONS are settable values to change running experience
# Optional Section: OPTIONS are settable values to change running experience
[OPTIONS]
# Optional Key: IO_Flag denotes whether or not to provide console output
# default = false
Expand Down
2 changes: 0 additions & 2 deletions onair/config/reporter_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ ComplexPluginDict = {'Complex Reporter 1':'plugins/reporter',

[OPTIONS]
IO_Enabled = true
Dev_Enabled = false
Viz_Enabled = false
16 changes: 6 additions & 10 deletions onair/src/run_scripts/execution_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import importlib
import ast
import shutil
from distutils.dir_util import copy_tree
from shutil import copytree
from time import gmtime, strftime

from ..run_scripts.sim import Simulator
Expand Down Expand Up @@ -65,8 +65,7 @@ def parse_configs(self, config_filepath):
config = configparser.ConfigParser()

if len(config.read(config_filepath)) == 0:
raise FileNotFoundError(
f"Config file at '{config_filepath}' could not be read.")
raise FileNotFoundError(f"Config file at '{config_filepath}' could not be read.")

try:
# Parse Required Data: FILES
Expand Down Expand Up @@ -102,8 +101,7 @@ def parse_configs(self, config_filepath):
self.IO_Enabled = False

except KeyError as e:
new_message = f"Config file: '{
config_filepath}', missing key: {e.args[0]}"
new_message = f"Config file: '{config_filepath}', missing key: {e.args[0]}"
raise KeyError(new_message) from e

def parse_plugins_dict(self, config_plugin_dict):
Expand All @@ -112,13 +110,11 @@ def parse_plugins_dict(self, config_plugin_dict):
if isinstance(ast_plugin_dict.body, ast.Dict):
temp_plugin_dict = ast.literal_eval(config_plugin_dict)
else:
raise ValueError(f"Plugin dict {config_plugin_dict} from {
self.config_filepath} is invalid. It must be a dict.")
raise ValueError(f"Plugin dict {config_plugin_dict} from {self.config_filepath} is invalid. It must be a dict.")

for plugin_file in temp_plugin_dict.values():
if not (os.path.exists(plugin_file)):
raise FileNotFoundError(f"In config file '{self.config_filepath}' Plugin path '{
plugin_file}' does not exist.")
raise FileNotFoundError(f"In config file '{self.config_filepath}' Plugin path '{plugin_file}' does not exist.")
return temp_plugin_dict

def parse_data(self, parser_file_name, data_file_name, metadata_file_name, subsystems_breakdown=False):
Expand Down Expand Up @@ -171,7 +167,7 @@ def save_results(self, save_name):
save_path = os.environ['ONAIR_SAVE_PATH'] + \
'saved/' + save_name + '_' + complete_time
os.makedirs(save_path, exist_ok=True)
copy_tree(os.environ['ONAIR_TMP_SAVE_PATH'], save_path)
copytree(os.environ['ONAIR_TMP_SAVE_PATH'], save_path)

def set_run_param(self, name, val):
setattr(self, name, val)
Expand Down
Loading

0 comments on commit 9eb12bd

Please sign in to comment.