generated from geo-smart/use_case_template
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
248 changed files
with
1,974,453 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
from spellchecker import SpellChecker | ||
import nbformat | ||
import os | ||
import sys | ||
import string # Import the string module to get a list of punctuation characters | ||
|
||
def remove_punctuation(text): | ||
translator = str.maketrans('', '', string.punctuation) | ||
return text.translate(translator) | ||
|
||
def spell_check_notebook(filepath, ignore_words): | ||
spell = SpellChecker() | ||
spell.word_frequency.load_words(ignore_words) | ||
|
||
misspelled_words = {} | ||
|
||
with open(filepath, 'r', encoding='utf-8') as f: | ||
nb = nbformat.read(f, as_version=4) | ||
|
||
for cell in nb.cells: | ||
if cell.cell_type == 'markdown': | ||
# Preprocess the cell text to remove punctuation before splitting into words | ||
text = remove_punctuation(cell.source) | ||
misspelled = spell.unknown(text.split()) | ||
if misspelled: | ||
if filepath not in misspelled_words: | ||
misspelled_words[filepath] = set() | ||
misspelled_words[filepath].update(misspelled) | ||
|
||
return misspelled_words | ||
|
||
def spell_check_directory(directory, ignore_words): | ||
all_misspelled_words = {} | ||
for subdir, dirs, files in os.walk(directory): | ||
for file in files: | ||
if file.endswith('.ipynb'): | ||
filepath = os.path.join(subdir, file) | ||
result = spell_check_notebook(filepath, ignore_words) | ||
if result: | ||
all_misspelled_words.update(result) | ||
|
||
if all_misspelled_words: | ||
for filepath, words in all_misspelled_words.items(): | ||
print(f"Misspelled words in {filepath}: {', '.join(words)}") | ||
sys.exit(1) # Exit with a non-zero status code to indicate failure | ||
|
||
if __name__ == "__main__": | ||
ignore_list = [ | ||
"geoweaver", "workflow", "datasets", "snotel", "snowpack", "amsrderived", "highelevation", | ||
"snowpacktelemetrynetwork", "snowcastwormhole", "500m", "amsr", "decisionmaking", | ||
"qualitycontrolled", "pagehttpswwwearthdatanasagovsensorsamsre", "netcdf", "daac", "4km", | ||
"satelliteii", "usthe", "strategizing", "xband", "modis", "pagehttpswwwearthdatanasagovsensorsmodis", | ||
"nam", "amsrrelated", "adeosii", "mesoscale", "amsradeosii", "apis", "asos", "missionwater", | ||
"metadata", "shortterm", "groundbased", "hdf", "british", "october", "level2a", "gcomw1", "csv", | ||
"dataloggers", "columbia", "ascii", "tsv", "amsadeosii", "longterm", "onboard", "wrf", "km", "hdf5", | ||
"nsidc", "realtime", "satellitebased", "amsre", "level1a", "websitehttpswwwclimatologylaborggridmethtml", | ||
"124th", "cryospheric", "american", "timestamped", "geolocation", "nrcs", "satellitederived", "awdn", | ||
"1000m", "snowmelt", "nasas", "amsr2", "dataset", "gridmet", "hightech", "youll", "cryosphere", "µm", | ||
"250m", "highspatial", "hydroclimatic", "fsca", "workflow", "swe", "eg", "snowtel", "gportalhttpsgportaljaxajpgpr", 'scan', "gdp", "scansnowtel", "geo", "aoi", "climateengineorghttpclimateengineorg", "daily", "monitoring", "youre", "checkbox", "nasa", "toolhttpsclimatenorthwestknowledgenetmacagdpphp", "v6", "element", "thredds", "climate", "xy", "dropdown", "websitehttpwwwwccnrcsusdagovnwccinventory", "websitehttpsearthexplorerusgsgov", "havent", "wgethttpswwwclimatologylaborgwgetgridmethtml", "lpdaac", "mod09ga", "earthdata", "nasahttpsursearthdatanasagov", "shapefile", "statecounty", "gcomw", "dont", "snowtel", "opendap", "popup", "data", "wget", "categoryfuturewarning", "preprocess", "colormapped", "doesnt", "trainstartdate", "csvs", "png", "functionalities", "tuples", "warningsfilterwarningsignore", "urllib", "yearsit", "userdefined", "datetime", "dataframe", "preparecumulativehistorycsvs", "dataframes", "userspecified", "datan", "1st", "url", "netcdf4", "mai", "matplotlib", "dem", "futurewarnings", "nc", "forcetrue", "timesensitive", "trainenddate", "cumulative", "downloader", | ||
"Daily", "scan", "climate repository", "https://www.northwestknowledgenet.metdata/data", "data", "Element", "SNOTELmonitoring", "cumulative", "Climate", "repository", "repositoryhttpswwwnorthwestknowledgenetmetdatadata", "servicehttpssuzakueorcjaxajpgcomwresearchresdisthtml", "snowtel, data", "Climate Monitoring", | ||
"Adin" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../conda/environment.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../conda/environment.yml |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.0.0 |
24 changes: 24 additions & 0 deletions
24
book/_build/.jupyter_cache/executed/2eb7556659b9f1a5867460a1053b787d/base.ipynb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"cells": [], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.11.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Oops, something went wrong.