Skip to content

Commit e0a587e

Browse files
committed
Update stdout and comments
1 parent a891254 commit e0a587e

11 files changed

Lines changed: 127 additions & 127 deletions

ggd/check_recipe.py

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def _install(bz2, recipe_name, debug=False, meta_recipe=False, env_var_dir = "",
220220
5) env_var_dir: (str) The path to the meta-recipe tmp env var
221221
6) env_var_file: (str) The file path to the meta-recipe tmp env var json file
222222
7) parent_name: (str) If a meta-recipe, the name of the parent meta-recipe
223-
8) commands_file: (str) THe path to the subseted commands used for the specific Meta-Recipe ID if meta-recipe
223+
8) commands_file: (str) The path to the subsetted commands used for the specific Meta-Recipe ID if meta-recipe
224224
225225
Returns:
226226
+++++++
@@ -277,7 +277,7 @@ def _install(bz2, recipe_name, debug=False, meta_recipe=False, env_var_dir = "",
277277

278278
## Check for meta-recipe environment variables
279279
if op.exists(env_var_file):
280-
print("\n:ggd:check-recipe: Loading Meta-Recipe ID specific environmnet variables")
280+
print("\n:ggd:check-recipe: Loading Meta-Recipe ID specific environment variables")
281281

282282
## Load environment variables from json file
283283
meta_env_vars = json.load(open(env_var_file))
@@ -352,11 +352,11 @@ def get_recipe_from_bz2(fbz2):
352352
353353
Parameters:
354354
----------
355-
1) fbz2: The file path to the pre-built bz2 ggd package
355+
1) fbz2: (str) The file path to the pre-built bz2 ggd package
356356
357357
Return:
358358
+++++++
359-
1) The meta.yaml file as a dictionary
359+
1) (dict) The meta.yaml file as a dictionary
360360
"""
361361
import tarfile
362362

@@ -393,8 +393,8 @@ def _check_build(species, build):
393393
394394
Parameters:
395395
-----------
396-
1) species: The supplied species for the recipe being built
397-
2) build: The genome build for the recipe being built
396+
1) species: (str) The supplied species for the recipe being built
397+
2) build: (str) The genome build for the recipe being built
398398
399399
Returns:
400400
++++++++
@@ -507,7 +507,7 @@ def check_recipe(parser, args):
507507
## Create a tmp dir to store environment variables too.
508508
env_var_tmp_dir, env_var_file_path, final_commands_files = create_tmp_meta_recipe_env_file()
509509

510-
## Set meta-recipe specifc env vars
510+
## Set meta-recipe specific env vars
511511
os.environ["GGD_METARECIPE_ID"] = args.id
512512
os.environ["GGD_METARECIPE_ENV_VAR_FILE"] = env_var_file_path
513513
os.environ["GGD_METARECIPE_FINAL_COMMANDS_FILE"] = final_commands_files
@@ -559,7 +559,6 @@ def check_recipe(parser, args):
559559
shutil.rmtree(env_var_tmp_dir)
560560

561561
## Skip header check on meta recipe files
562-
#if species != "meta-recipe" and build != "meta-recipe":
563562
## Check that the file has a header
564563
if not check_header(install_path):
565564
print("\n:ggd:check-recipe: !!ERROR!!")
@@ -640,7 +639,7 @@ def check_recipe(parser, args):
640639
else: ## if already installed
641640
print("\n:ggd:check-recipe: Package already installed on your system")
642641
print(
643-
'\nggd:check-recipe: If the "-du" flag (dont_uninstall) is NOT set this package will be uninstalled'
642+
'\n:ggd:check-recipe: If the "-du" flag (dont_uninstall) is NOT set this package will be uninstalled'
644643
)
645644
print("\n:ggd:check-recipe: To recheck this recipe")
646645
if args.dont_uninstall == True:
@@ -723,14 +722,14 @@ def add_to_checksum_md5sums(installed_dir_path, yaml_file, recipe_checksum_file_
723722
724723
Parameters:
725724
-----------
726-
1) installed_dir_path: The directory path to the installed data files, excluding the version number
727-
2) yaml_file: The meta.yaml file for the recipe
728-
3) recipe_checksum_file_path: The file path to the checksum recipe to update
725+
1) installed_dir_path: (str) The directory path to the installed data files, excluding the version number
726+
2) yaml_file: (str) The meta.yaml file for the recipe
727+
3) recipe_checksum_file_path: (str) The file path to the checksum recipe to update
729728
730729
Returns:
731730
++++++++
732731
1) Nothing is returned. The checksum file is updated with each data file and it's md5sum.
733-
Each data file will be placed on its own line with a tab seperating the file's md5sum.
732+
Each data file will be placed on its own line with a tab separating the file's md5sum.
734733
"""
735734
print(":ggd:check-recipe: Updating md5sums for final data files\n")
736735
import glob
@@ -740,7 +739,7 @@ def add_to_checksum_md5sums(installed_dir_path, yaml_file, recipe_checksum_file_
740739
with open(recipe_checksum_file_path, "w") as cs_file:
741740
installed_files = glob.glob(op.join(installed_dir_path, "*"))
742741

743-
## Check the number of files are the same between the yaml file and the acutal data files
742+
## Check the number of files are the same between the yaml file and the actual data files
744743
final_files = yaml_file["about"]["tags"]["final-files"]
745744
assert len(final_files) == len(installed_files), (
746745
":ggd:check-recipe: The number of installed files does not match the number of final files listed in the recipe."
@@ -763,7 +762,7 @@ def add_final_files(installed_dir_path, yaml_dict, recipe_path, extra_files):
763762
Method to iterate through and add each of the final data files from the processed data package to
764763
the meta.yaml file of the checked recipe. (This should be called after the "check_files" function
765764
has passed.)
766-
The file types will be added as well. If they are common genomic file types, otherwise the
765+
The file types will be added as well. If they are common genomics file types, otherwise the
767766
file extension will be used.
768767
The meta.yaml file will be re-written with the new file types and final files.
769768
New meta.yaml fields =
@@ -773,10 +772,10 @@ def add_final_files(installed_dir_path, yaml_dict, recipe_path, extra_files):
773772
774773
Parameters:
775774
-----------
776-
1) installed_dir_path: The directory path to the installed data files
777-
2) yaml_dict: A dictionary of the meta.yaml file for the recipe
778-
3) recipe_path: The directory path to the recipe being checked
779-
4) extra_files: The name of the extra files found from check_files method
775+
1) installed_dir_path: (str) The directory path to the installed data files
776+
2) yaml_dict: (dict) A dictionary of the meta.yaml file for the recipe
777+
3) recipe_path: (str) The directory path to the recipe being checked
778+
4) extra_files: (list) The name of the extra files found from check_files method
780779
781780
Returns:
782781
++++++++
@@ -903,8 +902,8 @@ def check_final_files(installed_dir_path, yaml_file):
903902
904903
Parameters:
905904
-----------
906-
1) installed_dir_path: The directory path to the installed files
907-
2) yaml_file: The meta.yaml file for the recipe
905+
1) installed_dir_path: (str) The directory path to the installed files
906+
2) yaml_file: (str) The meta.yaml file for the recipe
908907
909908
Returns:
910909
++++++++
@@ -991,8 +990,8 @@ def remove_package_after_install(bz2, recipe_name, exit_num):
991990
992991
Parameters:
993992
-----------
994-
1) bz2: The bz2 file created during the conda build process of the data package
995-
2) exit_num: The exit number to exit the program with
993+
1) bz2: (str) The bz2 file created during the conda build process of the data package
994+
2) exit_num: (int) The exit number to exit the program with
996995
"""
997996
from .utils import get_conda_package_list, update_installed_pkg_metadata
998997

@@ -1037,7 +1036,7 @@ def remove_package_after_install(bz2, recipe_name, exit_num):
10371036

10381037

10391038
def check_header(install_path):
1040-
"""Method to check the final genomic headers have a header or not
1039+
"""Method to check the final genomics headers have a header or not
10411040
10421041
check_header
10431042
============
@@ -1054,11 +1053,11 @@ def check_header(install_path):
10541053
10551054
Parameters:
10561055
-----------
1057-
1) install_path: The path to the directory where the files have been installed into.
1056+
1) install_path: (str) The path to the directory where the files have been installed into.
10581057
10591058
Returns:
10601059
+++++++
1061-
True or False.
1060+
(bool) True or False.
10621061
- True if a header exist or if only a warning was given
10631062
- False if a header does not exists and is required
10641063
@@ -1282,7 +1281,7 @@ def check_files(
12821281
before_files,
12831282
bz2,
12841283
):
1285-
"""Method to check the presence of correct genomic files """
1284+
"""Method to check the presence of correct genomics files """
12861285
from fnmatch import fnmatch
12871286

12881287
P = "{species}/{build}:{recipe_name}".format(**locals())
@@ -1304,7 +1303,7 @@ def check_files(
13041303

13051304
base_tbx_tbi = [
13061305
x[:-3] for x in tbxs if x[:-3] in nons
1307-
] # Name of files that are bgzip and tabix3d
1306+
] # Name of files that are bgzip and tabixed
13081307

13091308
nons = [x for x in nons if x not in tbxs] # files not tabixed or tbi
13101309
nons = [x for x in nons if x not in base_tbx_tbi] # files not tabixed or tbi

ggd/install.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def add_install(p):
5555
"--id",
5656
metavar="Meta-recipe ID",
5757
help = ("The ID to use for the meta recipe being installed. For example, if installing the GEO meta-recipe for GEO Accession ID GSE123, use `--id GSE123`"
58-
" NOTE: GGD will NOT try to correcet the ID. The ID must be accurately entered with case sensitive alphanumeric order")
58+
" NOTE: GGD will NOT try to correct the ID. The ID must be accurately entered with case sensitive alphanumeric order")
5959
)
6060

6161
c.set_defaults(func=install)
@@ -129,7 +129,8 @@ def check_if_installed(ggd_recipe, ggd_jdict, prefix=None):
129129
2) ggd_jdict: (dict) The channel specific metadata file as a dictionary
130130
3) prefix: (str) The prefix/conda environment to check in
131131
132-
Retruns:
132+
Returns:
133+
++++++++
133134
1) False if not installed
134135
2) True if it is installed
135136
"""
@@ -161,7 +162,7 @@ def check_conda_installation(ggd_recipe, prefix=None):
161162
========================
162163
This method is used to check if the ggd data package has been installed by the conda system,
163164
without being installed by the ggd system. If it has, the recipe needs to be uninstalled and
164-
reinstalled. If not, the system continues to install the package using ggd.
165+
re-installed. If not, the system continues to install the package using ggd.
165166
166167
Parameters:
167168
-----------
@@ -209,15 +210,15 @@ def get_idname_from_metarecipe(accession_id, meta_recipe_name, jdict):
209210
===========================
210211
Get the new name based on an accession id for a recipe to be installed from a meta-recipe
211212
212-
Paramters:
213+
Parameters:
213214
----------
214215
1) accession_id: (str) The meta-recipe id for the new name
215216
2) meta_recipe_name: (str) The name of the meta recipe which is used to install the new recipe
216217
3) jdict: (dict) The channeldata metadata json file loaded as a dict. (Channel == the channel
217218
the meta recipe is in)
218219
Returns:
219220
++++++++
220-
1) The id sepecific recipe name from the meta recipe
221+
1) The id specific recipe name from the meta recipe
221222
"""
222223

223224
new_recipe_name = "{}-{}-v{}".format(accession_id,
@@ -322,7 +323,7 @@ def install_from_cached(ggd_recipes, ggd_channel, ggd_jdict, debug=False, prefix
322323
prefix=target_prefix, remove_old=False, add_packages=ggd_recipes
323324
)
324325

325-
## Checkusm
326+
## Checksum
326327
try:
327328
install_checksum(ggd_recipes, ggd_jdict, target_prefix)
328329
except ChecksumError as e:
@@ -438,7 +439,7 @@ def conda_install(ggd_recipes, ggd_channel, ggd_jdict, debug=False, prefix=None,
438439
try:
439440
import json
440441

441-
print("\n:ggd:install: Loading Meta-Recipe ID specific environmnet variables")
442+
print("\n:ggd:install: Loading Meta-Recipe ID specific environment variables")
442443
## Get the updated env var list
443444
meta_env_vars = json.load(open(env_var_file_path)) if os.path.exists(env_var_file_path) else {}
444445

@@ -466,7 +467,7 @@ def conda_install(ggd_recipes, ggd_channel, ggd_jdict, debug=False, prefix=None,
466467
fsize, tsize, bsize = get_file_size(os.path.join(path,f))
467468
file_size_dict[f] = fsize
468469

469-
## Update meta-recipe meatada
470+
## Update meta-recipe metadata
470471
success, new_bz2 = update_metarecipe_metadata(pkg_name = pkg_name,
471472
env_var_dict = meta_env_vars,
472473
parent_name = meta_recipe_name,
@@ -480,7 +481,7 @@ def conda_install(ggd_recipes, ggd_channel, ggd_jdict, debug=False, prefix=None,
480481
except Exception as e:
481482
from .uninstall import check_for_installation
482483
import traceback
483-
print("\n:ggd:install: !!ERROR!! Post-Installation problems while updaing meta-recipe metadata")
484+
print("\n:ggd:install: !!ERROR!! Post-Installation problems while updating meta-recipe metadata")
484485
print(str(e))
485486
print(traceback.print_exc())
486487
check_for_installation(
@@ -499,7 +500,7 @@ def conda_install(ggd_recipes, ggd_channel, ggd_jdict, debug=False, prefix=None,
499500
prefix=target_prefix, remove_old=False, add_packages=ggd_recipes, include_local = True if meta_recipe else False
500501
)
501502

502-
## Checkusm
503+
## Checksum
503504
try:
504505
install_checksum(ggd_recipes, ggd_jdict, target_prefix, meta_recipe, meta_recipe_name)
505506
except ChecksumError as e:
@@ -662,8 +663,8 @@ def install_checksum(pkg_names, ggd_jdict, prefix=conda_root(), meta_recipe = Fa
662663

663664
## Get checksum dict
664665
if meta_recipe:
665-
assert meta_recipe_name != "", "\n:ggd:install: !!ERROR!! Unable to preform checksum on a meta-recipe wihtout the parent meta-recipe name"
666-
print("\n:ggd:install: NOTICE: Skipping checkusm for meta-recipe {} => {}".format(meta_recipe_name, ", ".join(pkg_names)))
666+
assert meta_recipe_name != "", "\n:ggd:install: !!ERROR!! Unable to preform checksum on a meta-recipe without the parent meta-recipe name"
667+
print("\n:ggd:install: NOTICE: Skipping checksum for meta-recipe {} => {}".format(meta_recipe_name, ", ".join(pkg_names)))
667668
checksum_dict = {}
668669
# try:
669670
# checksum_dict = get_meta_recipe_checksum(meta_recipe_name, pkg_name)
@@ -702,12 +703,12 @@ def install_checksum(pkg_names, ggd_jdict, prefix=conda_root(), meta_recipe = Fa
702703

703704

704705
def copy_pkg_files_to_prefix(prefix, pkg_names, meta_recipe = False):
705-
"""Method to copy the tar and package files from the current conda envrionment to the target prefix
706+
"""Method to copy the tar and package files from the current conda environment to the target prefix
706707
707708
copy_pkg_files_to_prefix
708709
========================
709-
This method is used to copy the tarball file and the pkg file from the current conda envrionment to the
710-
target prefix if the prefix flag is set. This will support pkg info lookup for data management when installing
710+
This method is used to copy the tarball file and the pkg file from the current conda environment to the
711+
target prefix if the prefix flag is set. This will support pkg info lockup for data management when installing
711712
a package using the prefix flag
712713
713714
Parameters:
@@ -828,7 +829,7 @@ def install(parser, args):
828829

829830
## Check number of packages
830831
if len(pkg_list) > 1:
831-
print("\n:ggd:install: GGD is currenlty only able to install a single meta-recipe at a time. Please remove other pkgs and install them with a subsequent command")
832+
print("\n:ggd:install: GGD is currently only able to install a single meta-recipe at a time. Please remove other pkgs and install them with a subsequent command")
832833
sys.exit()
833834

834835
## Id must be lower case for conda
@@ -858,7 +859,7 @@ def install(parser, args):
858859

859860
## Check for success
860861
try:
861-
assert (success), "\n:ggd:install: !!ERROR!! There was a problem updating the meta-recipe to the ID speciifc recipe"
862+
assert (success), "\n:ggd:install: !!ERROR!! There was a problem updating the meta-recipe to the ID specific recipe"
862863
except AssertionError as e:
863864
print(str(e))
864865
if tmpdir:
@@ -881,7 +882,7 @@ def install(parser, args):
881882
from .check_recipe import _build
882883
try:
883884
new_bz2 = _build(new_recipe_path, recipe_yaml, debug = True if args.debug else False)
884-
assert (os.path.exists(new_bz2)), "\n:ggd:install: !!ERRORR!! There was a problem building the new recipe"
885+
assert (os.path.exists(new_bz2)), "\n:ggd:install: !!ERROR!! There was a problem building the new recipe"
885886
except Exception as e:
886887
print(str(e))
887888
if tmpdir:

ggd/list_files.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def in_ggd_channel(ggd_recipes, ggd_channel, C_ROOT, reporting=True, return_pkg_
7373
Method used to identify in the desired package is in the ggd-<channel>.
7474
If it is the the species, build, and version is returned.
7575
76-
Mutliple ggd recipes can be checked, but if the return_pkg_list parameter is set to false only the
76+
Multiple ggd recipes can be checked, but if the return_pkg_list parameter is set to false only the
7777
species, genome build, and version of the first ggd recipe are returned.
7878
7979
Parameters:
@@ -95,7 +95,7 @@ def in_ggd_channel(ggd_recipes, ggd_channel, C_ROOT, reporting=True, return_pkg_
9595
NOTE: Only the species, genome build, and version for the first recipe be returned.
9696
if return_pkg_list is True:
9797
1) the pkg list
98-
2) the channel specific dicitionary of packages
98+
2) the channel specific dictionary of packages
9999
"""
100100

101101
from .search import load_json, load_json_from_url, search_packages
@@ -138,7 +138,7 @@ def get_package_list(j_dict):
138138
139139
Returns:
140140
++++++++
141-
1) (list) The pckages that were found
141+
1) (list) The packages that were found
142142
"""
143143

144144
package_list = []

0 commit comments

Comments
 (0)