Skip to content

Commit

Permalink
Typos (#899)
Browse files Browse the repository at this point in the history
* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* free disk space in CI runs using docker to prevent image build failures

* add comment about source

* reorg workflow, add support for docker gha cache in CI

* undo gha caching changes since it's already done in conftest.py

* debugging failed builds

* debugging failed builds

* remove alternate_file

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* debugging failed builds

* fix typos
  • Loading branch information
chrispyles authored Jan 1, 2025
1 parent 581bb3e commit f0a3b23
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion otter/assign/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class TestsValue(fica.Config):
_ag_zip_name: Optional[str] = None
"""
the file name for the autograder zip file; this value is generated the first time it is accessed
since it contians a timestamp
since it contains a timestamp
"""

def __init__(self, user_config: Optional[dict[str, Any]] = None, **kwargs: Any) -> None:
Expand Down
2 changes: 1 addition & 1 deletion otter/assign/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def write_output_dir(
raise FileNotFoundError(f"{file} is not a file")
if str(assignment.master.parent) not in os.path.abspath(file):
raise ValueError(
f"{file} is not in a subdirectory of the master notebook direcotry"
f"{file} is not in a subdirectory of the master notebook directory"
)
file_path = pathlib.Path(file).resolve()
rel_path = file_path.parent.relative_to(assignment.master.parent)
Expand Down
2 changes: 1 addition & 1 deletion otter/assign/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def run_tests(assignment: "Assignment", debug: bool = False) -> None:
Grade a notebook and throw an error if it does not receive a perfect score.
Args:
assignment (``otter.assgin.assignment.Assignment``): the assignment config
assignment (``otter.assign.assignment.Assignment``): the assignment config
debug (``bool``): whether to throw errors instead of swallowing them during grading
Raises:
Expand Down
8 changes: 4 additions & 4 deletions otter/check/logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def unshelve(self, global_env: Optional[dict[str, Any]] = None) -> dict[str, Any
tf.seek(0)
shelf = dill.load(tf)

# add the unpickeld env and global_env to all function __globals__
# add the unpickled env and global_env to all function __globals__
for v in shelf.values():
if type(v) == types.FunctionType:
v.__globals__.update(shelf)
Expand Down Expand Up @@ -333,8 +333,8 @@ def shelve_environment(
env (``dict[str, Any]``): the environment to shelve
variables (``dict[str, str] | list[str] | None``): a map of variable name to type string
indicating **only** variables to include (all variables not in this dictionary will
be ignored) or a list of variable names to include regardless of tpye
ignore_modules (``list[str] | None``): the module names to igonre
be ignored) or a list of variable names to include regardless of type
ignore_modules (``list[str] | None``): the module names to ignore
Returns:
``tuple[bytes, list[str]``: the pickled environment and list of variable names that were
Expand Down Expand Up @@ -432,7 +432,7 @@ def question_iterator(self) -> "QuestionLogIterator":

def sort(self, ascending: bool = True):
"""
Sorts this logs entries by timestmap using ``LogEntry.sort_log``.
Sorts this logs entries by timestamp using ``LogEntry.sort_log``.
Args:
ascending (``bool``): whether to sort the log chronologically; defaults to ``True``
Expand Down
10 changes: 5 additions & 5 deletions otter/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ def assign_cli(*args: Any, **kwargs: Any):
@cli.command("check")
@_verbosity
@click.argument("file", type=click.Path(exists=True, dir_okay=False))
@click.option("-q", "--question", help="A specific quetsion to grade")
@click.option("-q", "--question", help="A specific question to grade")
@click.option(
"-t",
"--tests-path",
default=defaults["tests_path"],
type=click.Path(exists=True, file_okay=False),
help="Path to the direcotry of test files",
help="Path to the directory of test files",
)
@click.option("--seed", type=click.INT, help="A random seed to be executed before each cell")
def check_cli(*args: Any, **kwargs: Any):
Expand Down Expand Up @@ -159,7 +159,7 @@ def export_cli(*args: Any, **kwargs: Any):
@click.option(
"--no-requirements",
is_flag=True,
help="Disable auto-inclusion of unespecified requirements file at ./requirements.txt",
help="Disable auto-inclusion of unspecified requirements file at ./requirements.txt",
)
@click.option(
"--overwrite-requirements",
Expand All @@ -175,7 +175,7 @@ def export_cli(*args: Any, **kwargs: Any):
@click.option(
"--no-environment",
is_flag=True,
help="Disable auto-inclusion of unespecified environment file at ./environment.yml",
help="Disable auto-inclusion of unspecified environment file at ./environment.yml",
)
@click.option("-l", "--lang", help="Assignment programming language; defaults to Python")
@click.option("--username", help="Gradescope username for generating a token")
Expand All @@ -190,7 +190,7 @@ def export_cli(*args: Any, **kwargs: Any):
@click.option(
"--exclude-conda-defaults",
is_flag=True,
help="Whether to exlucde conda's defaults channel from the environment.yml file",
help="Whether to exclude conda's defaults channel from the environment.yml file",
)
@click.argument("files", nargs=-1)
def generate_cli(*args: Any, **kwargs: Any):
Expand Down
2 changes: 1 addition & 1 deletion otter/export/exporters/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def has_end(line: str) -> bool:

def sub_end_for_new_page(line: str) -> str:
"""
Subsitutes an end question comment for a newpage comment
Substitutes an end question comment for a newpage comment
The end question HTML comment (cf. ``otter.export.filter.has_end``) is replaced with the following
HTML comment to indicate a pagebreak in the LaTeX template.
Expand Down
2 changes: 1 addition & 1 deletion otter/grade/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main(
raise ValueError("You must specify an assignment name")
elif not re.match(r"^[\w\-.]+$", name):
raise ValueError(
"Assignment names may only contain letters, nubers, underscores, dashes, and periods"
"Assignment names may only contain letters, numbers, underscores, dashes, and periods"
)

if not isinstance(paths, tuple) and not isinstance(paths, list):
Expand Down
2 changes: 1 addition & 1 deletion otter/grade/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def grade_submission(
"""
Grade a submission in a Docker container.
If a sumbission times out, based on the timeout parameter or the container
If a submission times out, based on the timeout parameter or the container
exits in an error state a ``GradingResults`` object is created by using the
``GradingResults.without_results`` function and returned.
Expand Down
2 changes: 1 addition & 1 deletion otter/run/run_autograder/runners/abstract_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def sanitize_tokens(self):
Sanitize any references to the PDF submission upload token to prevent unauthorized access
when executing student code.
This method should be invokved from inside ``{self.ag_config.autograder_dir}/submission``
This method should be invoked from inside ``{self.ag_config.autograder_dir}/submission``
as part of ``run``.
"""
self.ag_config.token = None
Expand Down
4 changes: 2 additions & 2 deletions otter/test_files/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def get_plugin_data(self, plugin_name: str, default: Optional[T] = None) -> T:
"""
Retrieves data for plugin ``plugin_name`` in the results.
This method uses ``dict.get`` to retrive the data, so a ``KeyError`` is never raised if
This method uses ``dict.get`` to retrieve the data, so a ``KeyError`` is never raised if
``plugin_name`` is not found; rather, it returns ``None``.
Args:
Expand Down Expand Up @@ -389,7 +389,7 @@ def to_report_str(self) -> str:

def to_dict(self) -> dict[str, Any]:
"""
Converts these results into a dictinary, extending the fields of the named tuples in
Converts these results into a dictionary, extending the fields of the named tuples in
``results`` into key, value pairs in a ``dict``.
Returns:
Expand Down
2 changes: 1 addition & 1 deletion otter/test_files/abstract_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def update_score(self, new_score: Union[int, float]):
Override the score for this test file to a specified value.
Args:
new_score (``int | foat``): the new score
new_score (``int | float``): the new score
"""
self._score = new_score

Expand Down
2 changes: 1 addition & 1 deletion otter/test_files/exception_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _get_func_params(self) -> list[str]:

def call_func(self, global_environment: dict[str, Any]):
"""
Call the underlying test case function, passig in parameters from the global environment.
Call the underlying test case function, passing in parameters from the global environment.
If the signature of ``self.test_func`` contains a parameter called ``env``, the environment
is passed in. For all other parameters, that value from the global environment is passed in,
Expand Down
6 changes: 3 additions & 3 deletions otter/test_files/ok_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ def run_doctest(

doctestrunner = doctest.DocTestRunner(verbose=True)

runresults = io.StringIO()
with redirect_stdout(runresults), redirect_stderr(runresults), hide_outputs():
run_results = io.StringIO()
with redirect_stdout(run_results), redirect_stderr(run_results), hide_outputs():
doctestrunner.run(test, clear_globs=False)
with open(os.devnull, "w") as f, redirect_stderr(f), redirect_stdout(f):
result = doctestrunner.summarize(verbose=True)
# An individual test can only pass or fail
if result.failed == 0:
return (True, "")
else:
return False, runresults.getvalue()
return False, run_results.getvalue()


class OKTestFile(TestFile):
Expand Down
2 changes: 1 addition & 1 deletion otter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
def hide_outputs():
"""
Context manager for hiding outputs from ``display()`` calls. IPython handles matplotlib outputs
specially, so those are supressed too.
specially, so those are suppressed too.
"""
ipy = get_ipython()
if ipy is None:
Expand Down

0 comments on commit f0a3b23

Please sign in to comment.