castoredc / castoRedc

R wrapper to Castor EDC API
MIT License
3 stars 8 forks source link

Refactoring and documentation #42

Open reiniervlinschoten opened 4 months ago

reiniervlinschoten commented 4 months ago

The package is currently quite cluttered. Some functions need to retrieve data from several API endpoints (e.g. getStudyData). Currently this is done in the function body. However this way other functions need to implement these calls themselves. The package should be refactored to create special functions, and maybe save returned objects, so all functions can use this information. This would also make the easier to develop.

The same goes for documentation. All functions should have a docstring and comments indicating what exactly is happening. This way, we can also create an overview of which functions there are in the package. And move functions that are for internal use only to private.

reiniervlinschoten commented 1 month ago

In #51 I have started working on adding tests, please see the PR for what needs to be done In #52 I have started working on making the tests for getStudyDataPoints pass, please see the PR for what needs to be done.

After these 2 PRs, we need to make sure all tests changed and updated in #51 pass. All tests and code changes should work toward making sure output of the functions matches: tests/test_files/files_output