From f0a3b23664e16cabddbdb7c8dcb45acaf746ac27 Mon Sep 17 00:00:00 2001 From: Chris Pyles <40970945+chrispyles@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:25:27 -0800 Subject: [PATCH] Typos (#899) * 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 --- otter/assign/assignment.py | 2 +- otter/assign/output.py | 2 +- otter/assign/utils.py | 2 +- otter/check/logs.py | 8 ++++---- otter/cli.py | 10 +++++----- otter/export/exporters/utils.py | 2 +- otter/grade/__init__.py | 2 +- otter/grade/containers.py | 2 +- otter/run/run_autograder/runners/abstract_runner.py | 2 +- otter/test_files/__init__.py | 4 ++-- otter/test_files/abstract_test.py | 2 +- otter/test_files/exception_test.py | 2 +- otter/test_files/ok_test.py | 6 +++--- otter/utils.py | 2 +- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/otter/assign/assignment.py b/otter/assign/assignment.py index 20b25d99..e6dbf3c4 100644 --- a/otter/assign/assignment.py +++ b/otter/assign/assignment.py @@ -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: diff --git a/otter/assign/output.py b/otter/assign/output.py index 9d74de9a..66ca9564 100644 --- a/otter/assign/output.py +++ b/otter/assign/output.py @@ -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) diff --git a/otter/assign/utils.py b/otter/assign/utils.py index d7549bf8..6215c2ce 100644 --- a/otter/assign/utils.py +++ b/otter/assign/utils.py @@ -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: diff --git a/otter/check/logs.py b/otter/check/logs.py index bf144621..9a9f14ac 100644 --- a/otter/check/logs.py +++ b/otter/check/logs.py @@ -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) @@ -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 @@ -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`` diff --git a/otter/cli.py b/otter/cli.py index ef083bf7..541bf258 100644 --- a/otter/cli.py +++ b/otter/cli.py @@ -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): @@ -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", @@ -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") @@ -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): diff --git a/otter/export/exporters/utils.py b/otter/export/exporters/utils.py index 2ae45163..9dc3559f 100644 --- a/otter/export/exporters/utils.py +++ b/otter/export/exporters/utils.py @@ -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. diff --git a/otter/grade/__init__.py b/otter/grade/__init__.py index d2c2ac27..13816770 100644 --- a/otter/grade/__init__.py +++ b/otter/grade/__init__.py @@ -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): diff --git a/otter/grade/containers.py b/otter/grade/containers.py index 86fa791b..b533cdab 100644 --- a/otter/grade/containers.py +++ b/otter/grade/containers.py @@ -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. diff --git a/otter/run/run_autograder/runners/abstract_runner.py b/otter/run/run_autograder/runners/abstract_runner.py index e7c58ba4..2d5fbb4a 100644 --- a/otter/run/run_autograder/runners/abstract_runner.py +++ b/otter/run/run_autograder/runners/abstract_runner.py @@ -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 diff --git a/otter/test_files/__init__.py b/otter/test_files/__init__.py index 6ddf409a..9e115759 100644 --- a/otter/test_files/__init__.py +++ b/otter/test_files/__init__.py @@ -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: @@ -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: diff --git a/otter/test_files/abstract_test.py b/otter/test_files/abstract_test.py index 41f6adf4..262aac55 100644 --- a/otter/test_files/abstract_test.py +++ b/otter/test_files/abstract_test.py @@ -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 diff --git a/otter/test_files/exception_test.py b/otter/test_files/exception_test.py index 118c6b0e..0ae6b457 100644 --- a/otter/test_files/exception_test.py +++ b/otter/test_files/exception_test.py @@ -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, diff --git a/otter/test_files/ok_test.py b/otter/test_files/ok_test.py index 66695eef..0578c5db 100644 --- a/otter/test_files/ok_test.py +++ b/otter/test_files/ok_test.py @@ -41,8 +41,8 @@ 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) @@ -50,7 +50,7 @@ def run_doctest( if result.failed == 0: return (True, "") else: - return False, runresults.getvalue() + return False, run_results.getvalue() class OKTestFile(TestFile): diff --git a/otter/utils.py b/otter/utils.py index 358804fd..26b2a384 100644 --- a/otter/utils.py +++ b/otter/utils.py @@ -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: