Skip to content

Commit 3171b21

Browse files
authored
Merge pull request #32 from lsst-epo/31-add-project-copy-from-template-method
Added copy-project method
2 parents 2e9b9db + e775122 commit 3171b21

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

pyproject.toml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "rubin.citsci"
7-
version = "0.3.2"
7+
authors = [
8+
{ email = "eric.rosas@noirlab.edu" },
9+
{ name = "Eric Rosas" }
10+
]
11+
description = "The companion package to the Rubin citizen science notebooks."
12+
13+
version = "0.4.0"
814
readme = "README.md"
915
dependencies = [
1016
"panoptes_client",
1117
'google.cloud.storage',
1218
'requests',
13-
]
19+
]
20+
21+
[project.urls]
22+
"Homepage" = "https://rubinobservatory.org/for-scientists/citizen-science"

src/rubin/citsci/pipeline.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,23 @@ def __init__(self):
5656
else:
5757
self.dev_mode_url = ""
5858

59+
def create_new_project_from_template(project_name="crhiggs/template-test"):
60+
"""
61+
This method will create a new project under the authenticated user's account
62+
based on the provided project template slug. If no project template slug is
63+
provided then a new project will be created from a Rubin test project
64+
template.
65+
66+
Must be authenticated into the Zooniverse API or an exception will occur.
67+
68+
Returns an instance of a Zooniverse project.
69+
"""
70+
71+
project_template = Project.find(slug=project_name)
72+
my_template_project = project_template.copy()
73+
my_template_project.save()
74+
return my_template_project
75+
5976
def login_to_zooniverse(self, slug_name, email):
6077
"""
6178
This method assumes that you have already created an account on the Zooniverse

0 commit comments

Comments
 (0)