Skip to content

Modernization Tier 1: safe, mechanical Python cleanups #41

Description

@shreyasgm

Tier 1 of a codebase modernization pass. These are low-risk, mechanical changes with no behavior impact. They should all land in a single commit/PR.

Scope

  • Fix broken install_requires in setup.py:21-23 — missing comma silently concatenates 'numpy >1.22.0' 'scikit-learn >1.0.0' into one string, so scikit-learn is never pinned. (Already flagged by users in Install problem and some question #32.)
  • Remove unused imports
    • ComplexityData.py:5-8: sys, functools.wraps, time, datetime
    • calc_density.py, calc_proximity.py, coicog.py: unused pandas as pd
    • proximity.py:3-4: duplicate calc_proximity imports
  • Replace == False / == True with boolean idioms
    • calc_proximity.py:22,25
    • ecomplexity.py:203,210,215
    • proximity.py:70,74,76
  • Convert remaining .format() to f-stringComplexityData.py:161
  • Replace print() with logging / warningsecomplexity.py:103,176, proximity.py:52. Libraries shouldn't write to stdout unconditionally; verbose flag should control a logger.
  • Drop class Foo(object)ComplexityData.py:11. Python 3 implies object.
  • Remove commented-out print calls in coicog.py:17,23.

Non-goals

No behavior changes, no API changes, no type hints, no packaging migration. Those are separate tiers.

Acceptance

  • pip install -e . succeeds and correctly pins scikit-learn.
  • All existing outputs identical (verify by running the README example and diffing against a saved reference if we can capture one — see the companion tests issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions