Skip to content

[pull] master from udacity:master #1

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

Open
wants to merge 54 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
af6d07d
Refactor Board class with simpler state representation to expedite co…
cgearhart Feb 7, 2017
b9bd875
mend
cgearhart Feb 7, 2017
5d91287
State the relationship between CustomPlayer parameters: search_depth …
luzileung Feb 10, 2017
2ec9a8d
Test for calling wrong heuristic in get_move()
cgearhart Feb 19, 2017
65b521c
Clean up unit tests
cgearhart Feb 19, 2017
a1f095d
Merge branch 'fast_board'
cgearhart Feb 19, 2017
2d1afa0
Fix potential bug in search move ordering.
cgearhart Feb 19, 2017
e57f8b6
Create .gitignore
luiscosio Mar 3, 2017
437124b
Mark legal_moves parameter in CustomPlayer.get_move as deprecated
cgearhart Mar 24, 2017
091485c
Avoid magic method syntax for private method call in isolation.Board …
cgearhart Mar 24, 2017
f15f1c5
Fix unit tests
cgearhart Mar 24, 2017
136dabe
Merge pull request #2 from luzi82/fix-20170210
cgearhart Mar 24, 2017
37c69cc
Merge pull request #5 from luiscosio/patch-1
cgearhart Mar 24, 2017
262764b
Add vizualization tool for isolation
cgearhart Mar 24, 2017
fd19d64
Fix markdown GIF link
cgearhart Mar 24, 2017
b31324a
Fix display indexing in visualization tool
cgearhart Mar 24, 2017
2a5963a
Fix coordinate order in visualization tool
cgearhart Mar 24, 2017
d2b2161
Fix bug in isolation.py with board initialization
cgearhart Mar 27, 2017
e5a0856
feat add Udacity project assistant submission script
cgearhart Apr 16, 2017
24cd0b6
refactor agent classes to simplify and clarify project requirements
cgearhart Apr 9, 2017
57f67b0
refactor project unit tests for Udacity project assistant
cgearhart Apr 16, 2017
b9eba43
docs update project readme and add docs for Board class interface
cgearhart Apr 16, 2017
7bfa3d5
fix isolation and sample players to match updated interface
cgearhart Apr 16, 2017
cc60e91
feat update tournament test procedure for more accurate performance e…
cgearhart Apr 16, 2017
51487e7
Add reports as optional files to isolation submit command so that the…
cgearhart Apr 21, 2017
5f92173
Add project submission instructions to the README.
cgearhart Apr 21, 2017
f59d34d
FIX isoviz compatibility with multiple browsers and instructions for …
cgearhart Apr 22, 2017
5849fd6
Removed dialogue for non-competition submission
scbrubaker02 Apr 22, 2017
758527f
Merge pull request #15 from udacity/revised-command-line-options
cgearhart Apr 22, 2017
f08bd92
Update the submission instructions in the README
cgearhart Apr 22, 2017
d1bebc4
Remove instruction for custom_score_2 to be best heuristic
jamesandersen Apr 23, 2017
a1f420a
Fix minor typo
jamesandersen Apr 23, 2017
39a8c3e
Display the board before the human player has to select a move
Apr 24, 2017
ca9863d
Merge pull request #17 from mxg312/master
cgearhart Apr 24, 2017
e1d0a14
Merge pull request #16 from jamesandersen/jamesandersen-patch-1
cgearhart Apr 24, 2017
045c606
FIX Issue #18 - Add list of allowed module imports to project README
cgearhart Apr 25, 2017
123aeda
FIX center score calculation (Issue #19)
cgearhart Apr 26, 2017
d100b8e
FIX reference to baseline agent in text printed with tournament.py
cgearhart Apr 26, 2017
fb44627
DOCS remove reference to CustomPlayer class (deprecated)
cgearhart Apr 29, 2017
d16b68d
Added error message when project name command line argument omitted
scbrubaker02 May 1, 2017
1db6283
Fixed link to FAQ
scbrubaker02 May 1, 2017
3303502
Updated README with improved udacity-pa install link.
scbrubaker02 May 4, 2017
26255ad
Added couple of import statements in the sample code in README.md, to…
anandsaha May 16, 2017
ecdc316
Format printed strings programmatically, based on number of agents
loredanacirstea May 29, 2017
b8937c4
FIX remove unnecessary comparison in tallying forfeits in tournament.py
cgearhart Jun 5, 2017
e1a2f53
FIX correctly count all forfeits & timeouts in tournament.py
cgearhart Jun 5, 2017
0088332
Merge pull request #24 from anandsaha/master
cgearhart Jun 5, 2017
a4afad6
Merge pull request #28 from loredanacirstea/tournament-print
cgearhart Jun 5, 2017
9068fd3
Fix misleading warning message for forfeits
nblumoe Sep 15, 2017
b903013
Merge pull request #35 from nblumoe/patch-1
cgearhart Oct 2, 2017
db766a3
:rotating_light: Create unit test module
jpventura Oct 5, 2017
33dcf67
Merge pull request #36 from jpventura/unit-test
cgearhart Dec 4, 2017
db6e052
ADD LICENSE file
cgearhart Feb 1, 2018
ef851c1
Add archival note to README
SudKul Jun 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@

# Created by https://www.gitignore.io/api/python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# 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/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
.venv/
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# End of https://www.gitignore.io/api/python
98 changes: 98 additions & 0 deletions .udacity-pa/projects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import os

from udacity_pa import udacity

from glob import glob

SETTINGS = {
"isolation": {
"required": {
"game_agent": {"ext": ["py"], "size": 0.2},
},
"optional": {
"heuristic_analysis": {"ext": ["pdf"], "size": 6.0},
"research_review": {"ext": ["pdf"], "size": 6.0},
}
},
"isolation-pvp": {
"required": {
"competition_agent": {"ext": ["py"], "size": 0.2},
},
"optional": {
"data": {"ext": ["json"], "size": 4}
}
}
}
nanodegree = "nd889"
projects = list(SETTINGS.keys())


RESUBMIT_MSG = """
NOTICE:

You are about to submit your agent. If you have previously submitted
your agent, continuing will replace that submission.

"""


def require_confirmation(text):
print(text)
ans = input("Please type 'yes' to confirm submission>")
print()
if ans.lower() != "yes":
print(
" Submission aborted -- you must confirm submission to proceed.\n"
)
exit()


def validate_file_info(pattern, lo=1, hi=1, size=6, ext=[]):

filenames = [x for x in glob(pattern + ".*")
if not ext or str.lower(os.path.splitext(x)[-1])[1:] in ext]

if not (lo <= len(filenames) <= hi):
raise RuntimeError(
("Submission Failed - a required file was missing. At least " +
"{!s} file(s) and no more than {!s} file(s) that match the " +
"pattern '{!s}.<EXT>' with one of the extensions: {!s} must " +
"be found in the current working directory.")
.format(lo, hi, pattern, ext))

large_files = [x for x in filenames if os.stat(x).st_size > size * 2**20]
if large_files:
raise RuntimeError(
("Submission Failed: One or more files is too large. Please " +
"make sure that the following files are under {!s}MB and try " +
"again: {!s}").format(size, large_files))

return filenames


def submit(options):

if len(options.args) == 0 or options.args[0] not in projects:
raise RuntimeError("You must specifiy 'isolation' or 'isolation-pvp' after 'udacity submit'.")

project_name = options.args[0]
if project_name == 'isolation-pvp':
require_confirmation(RESUBMIT_MSG)
patterns = SETTINGS.get(project_name, {})
if not patterns:
raise RuntimeError("")

required_files = [validate_file_info(ptn, **kwargs)
for ptn, kwargs in patterns.get("required", {}).items()]
optional_files = [validate_file_info(ptn, lo=0, **kwargs)
for ptn, kwargs in patterns.get("optional", {}).items()]
filenames = sum(required_files + optional_files, [])
file_info = (list(patterns.get("required", {}).values()) +
list(patterns.get("optional", {}).values()))
max_size = sum([dict(info).get("size", 0) for info in file_info]) * 2**20

udacity.submit(nanodegree,
project_name,
filenames,
environment = options.environment,
max_zip_size=max_size)
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2017 Udacity, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading