Closed dvenprasad closed 12 months ago
https://github.com/AlexsLemonade/scpca-portal/blob/dev/api/scpca_portal/models/computed_file.py#L128
We need to open the appropriate README and prepend "Generated On: YYYY-MM-DD" to the file before writing it to the zipfile. This should happen for each class method that generates a computed file zip.
We need to update the generated link to update the downloaded filename at time of download.
https://github.com/AlexsLemonade/scpca-portal/blob/dev/api/scpca_portal/models/computed_file.py#L329
def create_download_url(self):
"""Creates a temporary URL from which the file can be downloaded."""
if self.s3_bucket and self.s3_key:
date = datetime.today().strfrmtime("%Y-%M-%d")
filename = f"{date}_{self.s3_key}"
return s3.generate_presigned_url(
ClientMethod="get_object",
Params={
"Bucket": self.s3_bucket,
"Key": self.s3_key,
"ResponseContentDisposition": f"attachment; filename = {filename}"
},
ExpiresIn=(60 * 60 * 24 * 7), # 7 days in seconds.
)
@dvenprasad we can "templatize" the how to cite section instead of just prepending the "Generated On: 2023-10-26" to the readme's. We can also do project vs sample specific citation information.
Just noting that we're not going to do https://github.com/AlexsLemonade/scpca-portal/issues/451#issuecomment-1781781480, because that would capture the generation date not the access date. The access date is what we want for citations per the styles we'll suggest.
Context
We are adding a citation for the portal. Documentation ticket: https://github.com/AlexsLemonade/scpca-docs/issues/155
Problem or idea
Add the citation to the portal under
Citation
Section. Populate theAccessed download date
dynamically to the date the dataset was downloaded.Also add a link to the section is the docs explaining how to cite for projects without publications or pre-prints.
Solution or next step
The science team to provide copy for the above items.