Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor utility modules and test_utility.py #350

Open
7 tasks
alyssadai opened this issue Sep 28, 2024 · 0 comments
Open
7 tasks

Refactor utility modules and test_utility.py #350

alyssadai opened this issue Sep 28, 2024 · 0 comments
Labels
maint:refactor Simplifying or restructuring existing code or documentation. type:maintenance Upkeeping efforts & catch-up corrective improvements that are not Features nor Bugs

Comments

@alyssadai
Copy link
Contributor

alyssadai commented Sep 28, 2024

We have a growing number of *_utils.py modules for organizing utility functions shared across or specific to CLI commands. Currently, all these utility modules live in the same top-level directory as the main app (cli.py).

Meanwhile, we have a single test suite for all util functions, which is getting pretty big.

To better organize these util functions and their tests, we should:

  • create a package called utility or utilities to store all *_utils.py files
  • rename utility.py to utils.py for consistency w/ other modules
  • split test_utility.py into util-specific test modules
  • remove test_generate_context() since it replicates logic of function being tested and is hard to maintain
  • refactor out merging of context + final dataset instance for output .jsonld file, which overlaps across commands (Originally posted by @surchs in [ENH] Add derivatives command and pipeline-catalog submodule #349 (comment))
  • consider importing utils as a namespace instead of importing functions directly, for consistency w/ other modules
  • One idea could be to export methods from across the utility modules from a utils package, i.e. in the __init__.py file. That way at least I could import them all as from utils import get_Something, getAnotherthing. Another idea could be to generally reduce the number of sub-modules for utility methods to something more manageable. (Originally posted by @surchs in [ENH] Update bagel bids to handle JSONLD inputs incl. derivative metadata #356 (review))
@alyssadai alyssadai added maint:refactor Simplifying or restructuring existing code or documentation. type:maintenance Upkeeping efforts & catch-up corrective improvements that are not Features nor Bugs flag:schedule Flag issue that should go on the roadmap or backlog. and removed flag:schedule Flag issue that should go on the roadmap or backlog. labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maint:refactor Simplifying or restructuring existing code or documentation. type:maintenance Upkeeping efforts & catch-up corrective improvements that are not Features nor Bugs
Projects
Status: Backlog
Development

No branches or pull requests

1 participant