Skip to content

Commit

Permalink
prepend env variables with IAI
Browse files Browse the repository at this point in the history
  • Loading branch information
AlirezaMorsali committed Oct 19, 2022
1 parent 0fd02bf commit f0e0874
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion examples/Carla_Examples/Carla-Demo-Script-Birdview.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from dotenv import load_dotenv

load_dotenv()
if os.environ.get("DEV", False):
if os.environ.get("IAI_DEV", False):
sys.path.append("../..")
from invertedai import CarlaEnv, CarlaSimulationConfig
import invertedai as iai
Expand Down
2 changes: 1 addition & 1 deletion examples/Carla_Examples/Carla-Demo-Script.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dotenv import load_dotenv

load_dotenv()
if os.environ.get("DEV", False):
if os.environ.get("IAI_DEV", False):
sys.path.append("../../")
import invertedai as iai
from invertedai import CarlaEnv, CarlaSimulationConfig
Expand Down
2 changes: 1 addition & 1 deletion examples/Carla_Examples/Carla-Scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from dotenv import load_dotenv

load_dotenv()
if os.environ.get("DEV", False):
if os.environ.get("IAI_DEV", False):
sys.path.append("../../")
import invertedai as iai
from invertedai.simulators import CarlaEnv, CarlaSimulationConfig
Expand Down
6 changes: 3 additions & 3 deletions examples/Demo_Drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import argparse

os.environ["IAI_MOCK_API"] = "0"
os.environ["DEV"] = "1"
# os.environ["DEV_URL"] = "http://localhost:8888"
os.environ["IAI_DEV"] = "1"
# os.environ["IAI_DEV_URL"] = "http://localhost:8888"

if os.environ.get("DEV", False):
if os.environ.get("IAI_DEV", False):
sys.path.append("../")
import invertedai as iai

Expand Down
6 changes: 3 additions & 3 deletions examples/Demo_Drive_REST.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import argparse

os.environ["IAI_MOCK_API"] = "0"
os.environ["DEV"] = "1"
# os.environ["DEV_URL"] = "http://localhost:8888"
os.environ["IAI_DEV"] = "1"
# os.environ["IAI_DEV_URL"] = "http://localhost:8888"

if os.environ.get("DEV", False):
if os.environ.get("IAI_DEV", False):
sys.path.append("../")
import invertedai as iai

Expand Down
8 changes: 4 additions & 4 deletions examples/Drive-Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 1,
"id": "609dafe1",
"metadata": {},
"outputs": [
Expand All @@ -29,7 +29,7 @@
"if not IAI_API_KEY:\n",
" print(\"Running mock API - specify IAI_API_KEY to obtain real results\") \n",
" os.environ['IAI_MOCK_API'] = '0'\n",
" os.environ[\"DEV\"] = \"1\"\n",
" os.environ[\"IAI_DEV\"] = \"1\"\n",
"sys.path.append('../')\n",
"# !pip install invertedai==0.0.3rc1"
]
Expand Down Expand Up @@ -70,7 +70,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "423e03bd479d4a4b9a64df10e2129a5c",
"model_id": "986e836e721142e4b5e51a25e0cd774c",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -84,7 +84,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3da95c9fdece46e4965663dfefadffca",
"model_id": "5dddfaa5934f4bdda05fa3405e087218",
"version_major": 2,
"version_minor": 0
},
Expand Down
12 changes: 6 additions & 6 deletions invertedai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
from invertedai.simulation import Simulation
from invertedai.utils import Jupyter_Render, IAILogger, Session

dev = os.environ.get("DEV", False)
dev = os.environ.get("IAI_DEV", False)
if dev:
dev_url = os.environ.get("DEV_URL", "http://localhost:8000")
log_level = os.environ.get("LOG_LEVEL", "WARNING")
log_console = os.environ.get("LOG_CONSOLE", 1)
log_file = os.environ.get("LOG_FILE", 0)
api_key = os.environ.get("API_KEY", "")
dev_url = os.environ.get("IAI_DEV_URL", "http://localhost:8000")
log_level = os.environ.get("IAI_LOG_LEVEL", "WARNING")
log_console = os.environ.get("IAI_LOG_CONSOLE", 1)
log_file = os.environ.get("IAI_LOG_FILE", 0)
api_key = os.environ.get("IAI_API_KEY", "")

logger = IAILogger(level=log_level, consoel=bool(log_console), log_file=bool(log_file))

Expand Down

0 comments on commit f0e0874

Please sign in to comment.