Closed prisae closed 5 years ago
I did some stuff in the original scripts for empymod
, subsequently changed them for SimPEG
, and then for emg3d
. Now you did some further changes. I think all that passing around made a mess out of
def _add_package(self, module, name=None, optional=False)
def _add_package_by_name(self, name, optional=False)
def add_packages(self, packages, optional=False)
def get_version(self, pckg)
That should probably be simplified and cleaned up...
=> There are many duplications within these sfunctions.
I also added changes to in_ipykernel
, as you had some misleading comments. Of course a notebook IS ALSO IPython, I tried to clarify a few things.
OK, I am done with this PR. Let me know what you think!
I think there should be a distinction between version not available and package not available. For example:
>>> scooby.Report(['gdal', 'foo'], )
--------------------------------------------------------------------------------
Date: Sun Jun 30 10:45:49 2019 MDT
Darwin : OS
12 : CPU(s)
x86_64 : Machine
64bit : Architecture
32.0 GB : RAM
Python : Environment
Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 15:43:19)
[Clang 4.0.1 (tags/RELEASE_401/final)]
NA : gdal
NA : foo
1.16.3 : numpy
1.3.0 : scipy
7.5.0 : IPython
3.1.0 : matplotlib
0.2.2 : scooby
Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for
Intel(R) 64 architecture applications
--------------------------------------------------------------------------------
As a developer receiving that report, I'd like to know that yes gdal
is installed even though scooby doesn't know how to get the version but foo
is not installed.
Right now they nook the same (not installed) to someone receiving the report when infact gdal
is available and foo
is not
I just fixed https://github.com/banesullivan/scooby/pull/19#issuecomment-507050685 with 00dc525. Thought @prisae?
>>> scooby.Report(['gdal', 'foo'], )
--------------------------------------------------------------------------------
Date: Sun Jun 30 11:00:06 2019 MDT
Darwin : OS
12 : CPU(s)
x86_64 : Machine
64bit : Architecture
32.0 GB : RAM
Python : Environment
Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 15:43:19)
[Clang 4.0.1 (tags/RELEASE_401/final)]
UNK : gdal
NA : foo
1.16.3 : numpy
1.3.0 : scipy
7.5.0 : IPython
3.1.0 : matplotlib
0.2.2 : scooby
Intel(R) Math Kernel Library Version 2018.0.3 Product Build 20180406 for
Intel(R) 64 architecture applications
--------------------------------------------------------------------------------
I'm not sure if UNK is the best acronym
What about
Pckg not found
Version unknown
I like those - more explicit/clear
Sorry, this got a bit a mess. Take want you want, feel free to remove things you don't like, we can iterate over it a bit.
investigate
; (closes #17)scooby.investigate()
andscoopy.Report()
were duplicates. We should just have one.scooby
onto the user. Again, we should be minimalistic. If a user does not want to printscooby
, he shouldn't have to.__init__.py
_add_package
and_add_package_by_name
; most of these things were duplicated things done inget_version
anyway. It is much simpler now.flake8
(flake8 scooby/*.py
) complaints (double lines, inline comments starting with#
, unused imports; too long lines; etc); typos