Giter Site home page Giter Site logo

sage-bionetworks / challengeutils Goto Github PK

View Code? Open in Web Editor NEW
4.0 6.0 9.0 8.25 MB

Synapse challenge utility functions

Home Page: https://sagebionetworks.org/challenges-benchmarking/

License: Apache License 2.0

Python 99.98% Dockerfile 0.02%
python synapse challenge dream benchmarking

challengeutils's Introduction

Sage Bionetworks Challenge Utilities

Warning

Starting early 2024, this package will no longer be maintained. We are in the process of creating a new-and-improved version of challengeutils - more information coming soon!

Get challengeutils from PyPI Docker Automated Docker Pull Coverage Status

challengeutils is a set of tools and commands that provides an interface for managing crowd-sourced challenges administered on Synapse, including but not limited to, DREAM Challenges. Its main purpose is to ease the process of creating, monitoring, and ending a challenge, as well as provide useful functions for post-competition analysis. This package is being actively developed and maintained by DREAM and Informatics & Biocomputing (IBC), Computational Oncology Group at Sage Bionetworks.

Documentation

challengeutils functionality is documented, click here to check it out!

Installation

pip install challengeutils
challengeutils -v

This repository also uses pre-commit to autolint files according to Black's coding styles. To run the hook in your local dev environment, enter the following:

pip install pre-commit
pre-commit install

Now pre-commit will run automatically on git commit! For example:

$ git commit -m 'update readme' -a
Check Yaml...........................................(no files to check)Skipped
Fix End of Files.........................................................Passed
Trim Trailing Whitespace.................................................Passed
black................................................(no files to check)Skipped
[add-pre-commit 75b4393] update readme
 1 file changed, 23 insertions(+)

Contributing

Thinking about contributing to challengeutils? Get started by reading our Contributor Guide.

challengeutils's People

Contributors

andrewelamb avatar lgtm-com[bot] avatar mdsage1 avatar philerooski avatar thomasyu888 avatar tschaffter avatar tschafftersage avatar vpchung avatar xindiguo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

challengeutils's Issues

copy_thread should also copy replies

Currently the logic in copying threads and replies are in copy_forum. Update copy threads to have copy replies:

import synapseclient
syn = synapseclient.login
discussion_cls = challengeutils.discussion.DiscussionApi(syn)
thread_dict = discussion_cls.get_thread({threadid})
thread_bundle = challengeutils.discussion.copy_thread(syn, thread=thread_dict, project={projectid})
thread_replies = challengeutils.discussion.get_thread_replies(syn, {threadid})
for reply in thread_replies:
    challengeutils.discussion.copy_reply(syn, reply, thread_bundle['id'])

Simplify command download submission

Remove

if filepath is not None:
            os.rename(filepath, 'submission-' + args.submissionid)
            filepath = 'submission-' + args.submissionid
        submission_dict['file_path'] = 'submission-' + args.submissionid
        with open(args.output, "w") as sub_out:
            json.dump(submission_dict, sub_out)
        logger.info(args.output)

Separate DREAM challenge creation with minimal challenge creation

Currently our createchallenge creates a ton of components such as 2 projects and 4 teams that a user of the platform will most likely not appreciate. Convert this function into createdreamchallenge and re-scope the createchallenge function to create a more simple format.

use a release cycle

Should use semantic versioning with develop branch, etc. for managing updates. Can mirror what Synapse Python client does. @thomasyu888 we can discuss!

unregistering teams

Unregistering teams can only be done by a team manager of the team. Unsure if this would be helpful.

Add tests to cli

---------- coverage: platform darwin, python 3.7.6-final-0 -----------
Name                                                 Stmts   Miss  Cover
------------------------------------------------------------------------
challengeutils/__init__.py                               3      0   100%
challengeutils/__main__.py                             176    176     0%
challengeutils/__version__.py                            1      0   100%
challengeutils/challenge.py                              6      6     0%
challengeutils/createchallenge.py                      100     14    86%
challengeutils/discussion.py                           127     28    78%
challengeutils/download_current_lead_submission.py      35      2    94%
challengeutils/evaluation_queue.py                      34      0   100%
challengeutils/helpers.py                               67     39    42%
challengeutils/mirrorwiki.py                            51     51     0%
challengeutils/permissions.py                           29      4    86%
challengeutils/utils.py                                202     56    72%
challengeutils/writeup_attacher.py                      18     18     0%
------------------------------------------------------------------------
TOTAL                                                  849    394    54%

mirror wiki fails

challengeutils -v 
1.6.0
 challengeutils mirrorwiki syn21849256 syn21849255
Downloading  [####################]100.00%   4.0kB/4.0kB (1.9MB/s) 52779013.md Done...
Downloading  [####################]100.00%   757.0bytes/757.0bytes (3.3MB/s) 51494118.md Done...
    INFO:challengeutils.mirrorwiki:Updating: 
Traceback (most recent call last):
  File "/Users/tschaffter/dev/challengeutils/env/bin/challengeutils", line 10, in <module>
    sys.exit(main())
  File "/Users/tschaffter/dev/challengeutils/env/lib/python3.7/site-packages/challengeutils/__main__.py", line 580, in main
    perform_main(syn, args)
  File "/Users/tschaffter/dev/challengeutils/env/lib/python3.7/site-packages/challengeutils/__main__.py", line 563, in perform_main
    args.func(syn, args)
  File "/Users/tschaffter/dev/challengeutils/env/lib/python3.7/site-packages/challengeutils/__main__.py", line 41, in command_mirrorwiki
    args.forceupdate)
  File "/Users/tschaffter/dev/challengeutils/env/lib/python3.7/site-packages/challengeutils/mirrorwiki.py", line 103, in mirrorwiki
    for filehandle in copied_filehandles['copyResults']]
TypeError: list indices must be integers or slices, not str
Collapse

Reset docker submission tool (with quotas in mind)

{"key": "org.sagebionetworks.SynapseWorkflowHook.StatusDescription",
 "isPrivate": false,
 "value": "EXCEEDED TIME QUOTA"}
{"key": "org.sagebionetworks.SynapseWorkflowHook.TimeRemaining",
 "isPrivate": false,
 "value": 0}

test wiki names when mirroring

It chould notify if there are wiki pages without a matching name (either in the source and not the dest, or vice versa).

Submission status changer.

Closing #51, because the workflow is to fail the workflow job. But this status changer may still be helpful.

WorkflowHook feature -> Changing the status of a submission from ACCEPTED to INVALID, SCORED....

Rename the command line functions calls

Calls like:

challengeutils setevaluationquota
challengeutils killdockeroverquota
challengeutils downloadsubmission

Should probably just be

challengeutils set-evaluation-quota
challengeutils kill-docker-over-quota
challengeutils download-submission

This will be a breaking change.

Show URL to resources created after creating challenge

Once the challenge and all its resources have been created by challengeutils createchallenge, it would be user friendly to display the URL to the resources (staging site, prod site, teams, etc.) just before returning. For example

...
Challenge name (prod site): URL
Challenge name (staging site): URL
Challenge name Admin (team): URL
Challenge name Participants (team): URL
...

These information can be retrieved from the current log. The suggested solution would save the user of challengeutils from scrolling through the logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.