diff --git a/cytomine/models/annotation.py b/cytomine/models/annotation.py index e453325..14934b8 100644 --- a/cytomine/models/annotation.py +++ b/cytomine/models/annotation.py @@ -150,14 +150,14 @@ def profile(self): data = Cytomine.get_instance().get("{}/{}/profile.json".format(self.callback_identifier, self.id)) return data['collection'] if "collection" in data else data - def profile_projections(self, csv=False, csv_destination="projections-annotation-{id}.csv"): + def profile_projections(self, csv=False, csv_dest_pattern="projections-annotation-{id}.csv"): if self.id is None: raise ValueError("Cannot review an annotation with no ID.") - uri = "{}/{}/profile/projections.json".format(self.callback_identifier, self.id) + uri = "{}/{}/profile/projections.{}".format(self.callback_identifier, self.id, "csv" if csv else "json") if csv: pattern = re.compile("{(.*?)}") - destination = re.sub(pattern, lambda m: str(getattr(self, str(m.group(0))[1:-1], "_")), csv_destination) + destination = re.sub(pattern, lambda m: str(getattr(self, str(m.group(0))[1:-1], "_")), csv_dest_pattern) return Cytomine.get_instance().download_file(uri, destination, {"format": "csv"}) diff --git a/setup.py b/setup.py index bf57dde..8deac2f 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ setup( name='Cytomine-Python-Client', - version='2.7.0', + version='2.7.1', description='Python client to interact with Cytomine.', long_description=long_description, long_description_content_type="text/markdown",