NCAS-CMS / NCAS-CMS/cf-python

Consider best approach to avoid circular imports in `mixin` module

Open
#645 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

code tidy
Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

We agreed that it would be a good idea to consider if there is a better means to avoid circular imports in cf.mixin than having to hold certain files in a separate mixin2 directory, as implemented as a working but non-ideal solution in #630. See https://github.com/NCAS-CMS/cf-python/pull/630#discussion_r1171054985 for details.

This may not require any action i.e. code changes, should we realise the current approach is most suitable, but we should at least think about alternative options and which if any may be best, before closing.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the cf.mixin and mixin2 module layout and the discussion in pull request #630. Compare possible ways to avoid the circular imports without the separate directory, then document whether an alternative is preferable; done means reaching a clear decision before closing the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.