ga4gh / ga4gh/openapi-test-runner

Refactor Client class

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
5
Forks
6
PR merge metrics
No merged PRs in 30d

Description

The [Client](https://github.com/elixir-cloud-aai/tes-compliance-suite/blob/dev/compliance_suite/functions/client.py) class has methods with many recurring arguments. The class can be refactored on the following lines for better usability.

- Initiate a client with only those parameters that you need for multiple instance methods and that will be the same for every request. You don't want to instantiate a new client for every request you send.
- Remove all parameters from the instance methods that you already pass when instantiating the client and refer to them as `self.param`. No param should be passed to both the class constructor and any of the instance methods.
- Obviously define only those params in an instance method that you really need.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with compliance_suite/functions/client.py and inspect the Client constructor and its instance methods. Identify parameters repeated across requests, move shared values to the constructor, and remove duplicated or unnecessary method parameters. Done means each shared value is stored on the client and methods accept only the parameters they need.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.