Skip to content

Commit

Permalink
rename clear to clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing committed Dec 4, 2024
1 parent ee4ac42 commit 8267e50
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Notes:
(cupid-analysis) $ python -m ipykernel install --user --name=cupid-analysis
```

Furthermore, to clear the `computed_notebooks` folder which was generated by the `cupid-diagnostics` and `cupid-webpage` commands, you can run the following command:
Furthermore, to clean the `computed_notebooks` folder which was generated by the `cupid-diagnostics` and `cupid-webpage` commands, you can run the following command:

``` bash
$ cupid-clear
$ cupid-clean
```

This will clear the `computed_notebooks` folder which is at the location pointed to by the `run_dir` variable in the `config.yml` file.
This will clean the `computed_notebooks` folder which is at the location pointed to by the `run_dir` variable in the `config.yml` file.

### CUPiD Options

Expand Down
12 changes: 6 additions & 6 deletions cupid/clear.py → cupid/clean.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python
"""
This script provides functionality to clear the contents of the "computed_notebooks" folder
This script provides functionality to clean the contents of the "computed_notebooks" folder
at the location specified by the "run_dir" variable in the CONFIG_PATH.
The main function `clear()` takes the path to the configuration file as input, reads the config file
The main function `clean()` takes the path to the configuration file as input, reads the config file
to obtain the "run_dir" variable, and then deletes the contents of the "computed_notebooks" folder
at that location.
Expand Down Expand Up @@ -45,8 +45,8 @@ def read_config_file(config_path):
@click.command()
@click.argument("config_path", default="config.yml")
# Entry point to this script
def clear(config_path):
"""Clears the contents of the "computed_notebooks" folder at the location
def clean(config_path):
"""Cleans the contents of the "computed_notebooks" folder at the location
specified by the "run_dir" variable in the CONFIG_PATH.
Args: CONFIG_PATH - The path to the configuration file.
Expand All @@ -56,8 +56,8 @@ def clear(config_path):
run_dir = read_config_file(config_path)
# Delete the "computed_notebooks" folder and all the contents inside of it
shutil.rmtree(run_dir)
logger.info(f"All contents in {run_dir} have been cleared.")
logger.info(f"All contents in {run_dir} have been cleaned.")


if __name__ == "__main__":
clear()
clean()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ documentation = "https://nbscuid.readthedocs.io"
cupid-timeseries = "cupid.run_timeseries:run_timeseries"
cupid-diagnostics = "cupid.run_diagnostics:run_diagnostics"
cupid-webpage = "cupid.cupid_webpage:build"
cupid-clear = "cupid.clear:clear"
cupid-clean = "cupid.clean:clean"

0 comments on commit 8267e50

Please sign in to comment.