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

[Bugfix] pycharm debug loading project modules as standard library modules #2126

Merged
merged 15 commits into from
Dec 22, 2023

Conversation

Gamenot
Copy link
Collaborator

@Gamenot Gamenot commented Dec 21, 2023

Pycharm debug loads certain modules as if they were the core python modules as noted here: https://stackoverflow.com/a/68985644

This fixes the problem and manually sets the original modules as compatibility. The following have changed:

  • envision.types -> envision.etypes
  • smarts.core.utils.logging -> smarts.core.utils.core_logging
  • smarts.core.utils.math -> smarts.core.utils.core_math
  • smarts.sstudio.types -> smarts.sstudio.sstypes

Note that the original imports (e.g. import smarts.sstudio.types) will still work for now because of dynamic module assignment as shown below.

# smarts/core/utils/__init__.py
import sys
from . import core_math as math

# sys.modules["smarts.core.utils.math"] = math
sys.modules[f"{__name__}.{math=}".partition('=')[0]] = math

Closes #2125

@Gamenot Gamenot changed the title Bugfix pycharm debug modules [Bugfix] pycharm debug loading project modules as standard library modules Dec 21, 2023
@Gamenot Gamenot merged commit ed7cf21 into master Dec 22, 2023
26 checks passed
@Gamenot Gamenot deleted the tucker/bugfix_pycharm_debug_modules branch December 22, 2023 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Help Request] build scenario failed
1 participant