skyportal / gwemopt

Gravitational-wave Electromagnetic Optimization
GNU General Public License v3.0
19 stars 34 forks source link

Circular imports #99

Closed robertdstein closed 4 months ago

robertdstein commented 1 year ago

There are several direct circular imports I have found in gwemopt, e.g gwemopt.segments importing gwemopt.utils https://github.com/skyportal/gwemopt/blob/7c2b6b75dc5a16715a395722b620006dd495b966/gwemopt/segments.py#L21, but gwemopt.utils also importing gwemopt.segments https://github.com/skyportal/gwemopt/blob/7c2b6b75dc5a16715a395722b620006dd495b966/gwemopt/utils.py#L40.

I must confess I'm not really clear on how the current code even runs at all, since I thought these would raise errors immediately. Anyway, I think ideally these should be minimised, since you could get errors depending on which imports happen when/where.