e5680383654cdb3ca62ac1670c16bb603863c8e7,common/data_refinery_common/models/models.py,Experiment,update_num_samples,#Experiment#,330
Before Change
Update our cache values
self.num_total_samples = self.samples.count()
self.num_processed_samples = self.samples.filter(is_processed=True).count()
self.num_downloadable_samples = self.samples.filter(is_processed=True, organism__qn_target__isnull=False).count()
self.save()
def to_metadata_dict(self):
Render this Experiment as a dict
After Change
def update_num_samples(self):
Update our cache values
aggregates = self.samples.aggregate(
num_total_samples=Count("id"),
num_processed_samples=Count("id", filter=Q(is_processed=True)),
num_downloadable_samples=Count("id", filter=Q(is_processed=True, organism__qn_target__isnull=False))
)
self.num_total_samples = aggregates["num_total_samples"]
self.num_processed_samples = aggregates["num_processed_samples"]
self.num_downloadable_samples = aggregates["num_downloadable_samples"]
self.save()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: AlexsLemonade/refinebio
Commit Name: e5680383654cdb3ca62ac1670c16bb603863c8e7
Time: 2019-08-12
Author: arielsvn@gmail.com
File Name: common/data_refinery_common/models/models.py
Class Name: Experiment
Method Name: update_num_samples
Project Name: AlexsLemonade/refinebio
Commit Name: 3dece408885064d14883eb38547da2729950c50c
Time: 2019-02-28
Author: arielsvn@gmail.com
File Name: api/data_refinery_api/views.py
Class Name: Stats
Method Name: _get_job_stats
Project Name: chakki-works/doccano
Commit Name: 49d41416e440926f0a9a8243b4d77f6f5468efe9
Time: 2019-03-12
Author: light.tree.1.13@gmail.com
File Name: app/server/api.py
Class Name: StatisticsAPI
Method Name: progress