Skip to content

Commit

Permalink
Short github action pytest training
Browse files Browse the repository at this point in the history
  • Loading branch information
JacopoPan committed Nov 26, 2023
1 parent 9eca6c3 commit b155e60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gym_pybullet_drones/examples/learn.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
DEFAULT_AGENTS = 2
DEFAULT_MA = False

def run(multiagent=DEFAULT_MA, output_folder=DEFAULT_OUTPUT_FOLDER, gui=DEFAULT_GUI, plot=True, colab=DEFAULT_COLAB, record_video=DEFAULT_RECORD_VIDEO):
def run(multiagent=DEFAULT_MA, output_folder=DEFAULT_OUTPUT_FOLDER, gui=DEFAULT_GUI, plot=True, colab=DEFAULT_COLAB, record_video=DEFAULT_RECORD_VIDEO, local=True):

filename = os.path.join(output_folder, 'save-'+datetime.now().strftime("%m.%d.%Y_%H.%M.%S"))
if not os.path.exists(filename):
Expand Down Expand Up @@ -85,7 +85,7 @@ def run(multiagent=DEFAULT_MA, output_folder=DEFAULT_OUTPUT_FOLDER, gui=DEFAULT_
eval_freq=int(2000),
deterministic=True,
render=False)
model.learn(total_timesteps=3*int(1e5),
model.learn(total_timesteps=3*int(1e5) if local else int(1e2), # shorter training in GitHub Actions pytest
callback=eval_callback,
log_interval=100)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def test_downwash():

def test_learn():
from gym_pybullet_drones.examples.learn import run
run(gui=False, plot=False, output_folder='tmp')
run(gui=False, plot=False, output_folder='tmp', local=False)

0 comments on commit b155e60

Please sign in to comment.