Skip to content

Commit 27b38c4

Browse files
authored
CmampTask12067_Read_docs_about_DataPull_4 (#698)
* Update Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅ * Improve * Improve * Lint
1 parent f0353ab commit 27b38c4

19 files changed

+306
-174
lines changed

dev_scripts_helpers/coding_tools/parallel_script_skeleton.py renamed to dev_scripts_helpers/coding_tools/parallel_script_template.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
parallel.
66
77
# Run with:
8-
> clear; parallel_script_skeleton.py --workload success --num_threads serial
9-
> clear; parallel_script_skeleton.py --workload success --num_threads 2
10-
> clear; parallel_script_skeleton.py --workload failure --num_threads serial
11-
> clear; parallel_script_skeleton.py --workload failure --num_threads 3
8+
> clear; parallel_script_template.py --workload success --num_threads serial
9+
> clear; parallel_script_template.py --workload success --num_threads 2
10+
> clear; parallel_script_template.py --workload failure --num_threads serial
11+
> clear; parallel_script_template.py --workload failure --num_threads 3
1212
1313
Add a description of what the script does and examples of command lines.
1414
Check dev_scripts/linter.py to see an example of a script using this
1515
template.
1616
1717
Import as:
1818
19-
import dev_scripts_helpers.parallel_script_skeleton as dspascsk
19+
import dev_scripts_helpers.parallel_script_template as dspascsk
2020
"""
2121

2222
# TODO(gp): We should test this, although the library is already tested.

dev_scripts_helpers/coding_tools/script_skeleton.py renamed to dev_scripts_helpers/coding_tools/script_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
99
Import as:
1010
11-
import dev_scripts_helpers.script_skeleton as dscscske
11+
import dev_scripts_helpers.script_template as dscscske
1212
"""
1313

1414
import argparse

dev_scripts_helpers/coding_tools/transform_skeleton.py renamed to dev_scripts_helpers/coding_tools/transform_template.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
#!/usr/bin/env python
22

33
"""
4-
This is a skeleton example for a script that reads value from stdin or file,
4+
This is a template example for a script that reads value from stdin or file,
55
transforms it, and writes it to stdout or file.
66
77
This pattern is useful for integrating with editors (e.g., vim).
88
99
Import as:
1010
11-
import dev_scripts_helpers.transform_skeleton as dsctrske
11+
import dev_scripts_helpers.transform_template as dsctrske
1212
"""
1313

1414
import argparse
1515
import logging
1616

17-
import helpers.hdbg as hdbg
1817
import helpers.hparser as hparser
1918

2019
_LOG = logging.getLogger(__name__)

dev_scripts_helpers/documentation/run_pandoc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
:'<,'>!dev_scripts/documentation/run_pandoc.py -i - -o - -v CRITICAL
1414
```
1515
16-
This script is derived from `dev_scripts/transform_skeleton.py`.
16+
This script is derived from `dev_scripts/transform_template.py`.
1717
"""
1818

1919
import argparse

dev_scripts_helpers/old/fix_helpers_imports.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ $replace_text --old 'import helpers.translate' --new 'import helpers.htranslate'
159159
(cd $AMP_DIR;git mv helpers/unit_test.py helpers/hunit_test.py)
160160
$replace_text --old 'import helpers.unit_test' --new 'import helpers.hunit_test'
161161

162-
#unit_test_skeleton.py
162+
#unit_test_template.py
163163

164164
#versioning.py
165165
(cd $AMP_DIR;git mv helpers/versioning.py helpers/hversion.py)

docs/code_guidelines/all.code_like_pragmatic_programmer.how_to_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@
472472
- E.g., write prototype in Python and then code the production system in C++
473473

474474
- Tracer code:
475-
- Build architectural skeleton
475+
- Build architectural template
476476
- Components have minimal implementation
477477
- Over time stubbed routines are completed
478478
- The framework stays intact

docs/code_guidelines/all.coding_style.how_to_guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
+ [Examples of imports](#examples-of-imports)
7474
* [Scripts](#scripts)
7575
+ [Use Python and not bash for scripting](#use-python-and-not-bash-for-scripting)
76-
+ [Skeleton for a script](#skeleton-for-a-script)
76+
+ [Template for a script](#template-for-a-script)
7777
+ [Some useful patterns](#some-useful-patterns)
7878
+ [Use scripts and not notebooks for long-running jobs](#use-scripts-and-not-notebooks-for-long-running-jobs)
7979
+ [Follow the same structure](#follow-the-same-structure)
@@ -340,7 +340,7 @@
340340
- The name needs to be (possibly) short and memorable
341341
- However, don't be afraid to use long names, if needed, e.g.,
342342
`process_text_with_full_pipeline_twitter_v1`
343-
- Сlarity is more important than number of bytes used
343+
- Clarity is more important than number of bytes used
344344
- The name should capture what the object represents, without reference to
345345
things that can change or to details that are not important
346346
- The name should refer to what objects do (i.e., mechanisms), rather than how
@@ -1213,17 +1213,17 @@
12131213
- Our approach is to make simple to create scripts in Python that are equivalent
12141214
to sequencing shell commands, so that can evolve in complex scripts
12151215
1216-
#### Skeleton for a script
1216+
#### Template for a script
12171217
12181218
- The ingredients are:
1219-
- [`/dev_scripts_helpers/coding_tools/script_skeleton.py`](/dev_scripts_helpers/coding_tools/script_skeleton.py):
1219+
- [`/dev_scripts_helpers/coding_tools/script_template.py`](/dev_scripts_helpers/coding_tools/script_template.py):
12201220
a template to write simple scripts you can copy and modify it
12211221
- [`/helpers/hsystem.py`](/helpers/hsystem.py): a set of utilities that make
12221222
simple to run shell commands (e.g., capturing their output, breaking on
12231223
error or not, tee-ing to file, logging, ...)
12241224
- `helpers` has lots of useful libraries
12251225
- The official reference for a script is
1226-
[`/dev_scripts_helpers/coding_tools/script_skeleton.py`](/dev_scripts_helpers/coding_tools/script_skeleton.py)
1226+
[`/dev_scripts_helpers/coding_tools/script_template.py`](/dev_scripts_helpers/coding_tools/script_template.py)
12271227
- You can copy this file and change it
12281228
- A simple example is:
12291229
[`/dev_scripts_helpers/git/gup.py`](/dev_scripts_helpers/git/gup.py)

0 commit comments

Comments
 (0)