86fa89f0f50e153d625108d93f1f9eb8ee59719e,workers/data_refinery_workers/processors/create_compendia.py,,_create_result_objects,#Any#,364

Before Change


    organism = job_context["samples"][organism_key][0].organism

    try:
        last_compendia = ComputedFile.objects.filter(
                                    is_compendia=True,
                                    compendia_organism=organism).order_by("-compendia_version")[-1]
        compendia_version = last_compendia.compendia_version + 1
    except Exception as e:
        // This is the first compendia for this Organism
        compendia_version = 1

After Change


    // Compendia Result Helpers
    primary_organism = job_context["samples"][organism_key][0].organism
    organisms = [primary_organism]
    compendia_version = CompendiaResult.objects.annotate(
                                                   organism_count=Count("organisms")
                                               ).filter(
                                                   primary_organism=primary_organism,
                                                   organisms__in=organisms,
                                                   organism_count=len(organisms)
                                               ).count() + 1
    // Save Compendia Results
    compendia_result = CompendiaResult()
    compendia_result.primary_organism = primary_organism
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: AlexsLemonade/refinebio
Commit Name: 86fa89f0f50e153d625108d93f1f9eb8ee59719e
Time: 2019-11-01
Author: davidsmejia@gmail.com
File Name: workers/data_refinery_workers/processors/create_compendia.py
Class Name:
Method Name: _create_result_objects


Project Name: MTG/freesound
Commit Name: ad76d9b9f2442e0c938ef100415f35055b823c11
Time: 2017-11-10
Author: andres.ferraro@upf.edu
File Name: search/management/commands/post_dirty_sounds_to_solr.py
Class Name: Command
Method Name: handle


Project Name: AlexsLemonade/refinebio
Commit Name: f1aba98889fe38cdb66219911436a7cb0a22aa84
Time: 2020-07-27
Author: willvauclain.dev@gmail.com
File Name: api/data_refinery_api/views/dataset.py
Class Name:
Method Name: validate_dataset