Skip to content

Commit

Permalink
Merge pull request #47 from lsst-epo/39-add-guard-rails-logging-to-th…
Browse files Browse the repository at this point in the history
…e-pypi-package-informing-the-pi-of-which-project-they-are-currently-taking-effect-on

39 add guard rails logging to the pypi package informing the pi of which project they are currently taking effect on
  • Loading branch information
ericdrosas87 authored Jul 3, 2024
2 parents e89b5ff + 30ba571 commit f99b3ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ authors = [
]
description = "The companion package to the Rubin citizen science notebooks."

version = "0.6.4"
version = "0.6.5"
readme = "README.md"
dependencies = [
"panoptes_client",
Expand Down
16 changes: 10 additions & 6 deletions src/rubin/citsci/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def login_to_zooniverse(self, email):
valid_email = self.__validate_email_address(email)

if(valid_email):
print("Loading and running utilities to establish a link with Zooniverse")
print("Enter your Zooniverse username followed by password below")
self.email = email
self.client = panoptes_client.Panoptes.connect(login="interactive")
if self.client.logged_in is True:
Expand Down Expand Up @@ -119,9 +121,8 @@ def __log_slug_names(self):
print(p["slug"])
print("\n*==========================*\n")

slug_name = input("Which project would you like to send data to (copy & paste the slug name here)?")

if has_projects == True:
slug_name = input("Which project would you like to send data to (copy & paste the slug name here)?")
if slug_name in slugnames:
self.project = Project.find(slug=slug_name)
self.project_id = self.project.id
Expand Down Expand Up @@ -197,7 +198,7 @@ def write_manifest_file(self, manifest, batch_dir):
Returns the relative path to the manifest.csv
"""

if self.project_sanity_check is False:
if self.project_sanity_check() is False:
print("Please create or specify a Zooniverse project before attempting to write a manifest file.")
return
manifest_filename = 'manifest.csv'
Expand All @@ -209,7 +210,10 @@ def write_manifest_file(self, manifest, batch_dir):
for cutout in manifest:
writer.writerow(cutout)

return f"{batch_dir}{manifest_filename}"
manifest_path = f"{batch_dir}{manifest_filename}"
print(f"The manifest CSV file can be found at the following relative path: {manifest_path}")

return manifest_path

def clean_up_unused_subject_set(self):
"""
Expand Down Expand Up @@ -355,7 +359,7 @@ def send_image_data(self, subject_set_name, zip_path, **options):
set is available.
"""

if self.project_sanity_check is False:
if self.project_sanity_check() is False:
print("Please create or specify a Zooniverse project before attempting to send image data!")
return
print("Send the data to Zooniverse")
Expand Down Expand Up @@ -420,7 +424,7 @@ def zip_image_cutouts(self, batch_dir):
to the Zooniverse, and returns the path to the zip file.
"""

if self.project_sanity_check is False:
if self.project_sanity_check() is False:
print("WARNING: You haven't specified a project yet, please ensure you have specified a project before proceeding.")
self.guid = str(uuid.uuid4())
shutil.make_archive(f"./{self.guid}", 'zip', batch_dir)
Expand Down

0 comments on commit f99b3ea

Please sign in to comment.