question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This is just meant as a discussion. But something that probably would have to be decided before the release of v1.0.

What about changing the module name from SimPEG to simpeg?

  • Pro’s:

    • Following the convention of most packages, in that the package and module names are identical.

    • Following pep8 guidelines, in which packages and modules should have all-lowercase names.

    • Less confusing. At the moment what a potential user would do (and what happend to me at the beginning several times) is

      1. pip install simpeg
      2. Fire-up an IPython shell or a notebook
      3. import simpeg

      with the result that it throws an error stating that simpeg is not installed. One has then to check the documentation or the examples to find out that the module to import is called SimPEG, not simpeg.

  • Con’s: Maybe too late for a change, too many scripts and notebooks exist which import SimPEG.

Just thought I initiate once the discussion. Maybe it was discussed before, I don’t know.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
prisaecommented, Jun 26, 2019

I think there is a possibility to deliver a new simpeg package and at the same time a SimPEG package which will only print information about the name-change. The important bit would be the line

    packages=['simpeg`, `SimPEG'],

in setup.py. Then, pip install simpeg or pip install SimPEG (pip is case-insensitive, I believe) would install both packages, simpeg and SimPEG. The directory SimPEG would then only contain a __init__.py-file. In there, we could put print-statements about all the changes. E.g.: SimPEG->simpeg, EM->electromagnetics, etc etc.

In this case, if someone does import simpeg all is good and as it used to be before with SimPEG. However, if someone does import SimPEG, it will print all the info we put into __init__.py.

Here an example with a fictitious testme/TestMe-package, install them via python setup.py install: testme.zip

And here a screenshot of it in action: IPython: home-dtr_001

0reactions
prisaecommented, May 27, 2020

I am closing this. As it didn’t happen in the simulation-PR it is unlikely going to happen. Re-open if you disagree 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

6. Modules — Python 3.11.1 documentation
The file name is the module name with the suffix .py appended. Within a module, the module's name (as a string) is available...
Read more >
How do I find the current module name in Python?
A module can find out its own module name by looking at the predefined global variable __name__. If this has the value '__main__', ......
Read more >
How do I find current module name in python - Edureka
A module can find out its own module name by looking at the predefined global variable __name__. def main(): print('test.
Read more >
Module.Name Property (System.Reflection) - Microsoft Learn
Name is a platform-dependent string. If the assembly for this module was loaded from a byte array then the FullyQualifiedName for the module...
Read more >
Python Modules - W3Schools
Consider a module to be the same as a code library. ... Import the module named mymodule, and call the greeting function: import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found