[ENH]: Implement a command to print the running environment details #33

Merged
synchon merged 11 commits from feature/wtf-cmd into main 2022-10-21 11:00:49 +00:00
synchon commented 2022-10-19 19:22:02 +00:00 (Migrated from github.com)

Are you requiring a new dataset or marker?

  • I understand this is not a marker or dataset request

Which feature do you want to include?

I've seen this in datalad and it's a very cool feature. When you run datalad wtf, you get a verbose print of all the characteristics of the runtime environment. Thus, whenever you submit an issue, you can copy/paste the output to help the developers understand what's going on.

How do you imagine this integrated in junifer?

As a new command in junifer.api.cli so we can run junifer wtf

Do you have a sample code that implements this outside of junifer?

No

Anything else to say?

We can check datalad, but beware of the license. Maybe we can also get an approval to copy/paste and release under AGPLv3.

### Are you requiring a new dataset or marker? - [X] I understand this is not a marker or dataset request ### Which feature do you want to include? I've seen this in datalad and it's a very cool feature. When you run `datalad wtf`, you get a verbose print of all the characteristics of the runtime environment. Thus, whenever you submit an issue, you can copy/paste the output to help the developers understand what's going on. ### How do you imagine this integrated in junifer? As a new command in `junifer.api.cli` so we can run `junifer wtf` ### Do you have a sample code that implements this outside of junifer? ```shell No ``` ### Anything else to say? We can check datalad, but beware of the license. Maybe we can also get an approval to copy/paste and release under AGPLv3.
synchon commented 2022-10-19 09:35:50 +00:00 (Migrated from github.com)

@fraimondo Do we start with something minimal for our use-case, or do we go "full" wtf?

@fraimondo Do we start with something minimal for our use-case, or do we go "full" wtf?
fraimondo commented 2022-10-19 09:39:59 +00:00 (Migrated from github.com)

The idea is to have something that can help us debug. I would go full wtf

The idea is to have something that can help us debug. I would go full wtf
synchon commented 2022-10-19 09:41:27 +00:00 (Migrated from github.com)

Okay I'll try to adapt the datalad code then.

Okay I'll try to adapt the datalad code then.
synchon commented 2022-10-19 09:50:26 +00:00 (Migrated from github.com)

Just a thought: we output it as JSON?

Just a thought: we output it as JSON?
fraimondo commented 2022-10-19 09:53:14 +00:00 (Migrated from github.com)

nono, print in the terminal

check datalad wtf

nono, print in the terminal check `datalad wtf`
synchon commented 2022-10-19 09:53:58 +00:00 (Migrated from github.com)

Okay. Well what I meant was output JSON in terminal so it's easy to copy and paste.

Okay. Well what I meant was output JSON in terminal so it's easy to copy and paste.
fraimondo commented 2022-10-19 09:54:02 +00:00 (Migrated from github.com)

Okay I'll try to adapt the datalad code then.

Ask for permission, they use a different licence!

> Okay I'll try to adapt the datalad code then. Ask for permission, they use a different licence!
fraimondo commented 2022-10-19 10:00:14 +00:00 (Migrated from github.com)

Yes, but we use AGPLv3, so we are restricting more.

Yes, but we use AGPLv3, so we are restricting more.
synchon commented 2022-10-19 10:01:08 +00:00 (Migrated from github.com)

Okay I'll try to adapt the datalad code then.

Ask for permission, they use a different licence!

They use MIT which I think allows for copying, I'll ask anyway.

> > Okay I'll try to adapt the datalad code then. > > Ask for permission, they use a different licence! They use MIT which I think allows for copying, I'll ask anyway.
synchon commented 2022-10-19 10:01:46 +00:00 (Migrated from github.com)

Yes, but we use AGPLv3, so we are restricting more.

We will anyway adapt it and not have the exact same code.

> Yes, but we use AGPLv3, so we are restricting more. We will anyway adapt it and not have the exact same code.
fraimondo commented 2022-10-19 10:09:03 +00:00 (Migrated from github.com)

Yes, but we use AGPLv3, so we are restricting more.

We will anyway adapt it and not have the exact same code.

Reading is also some way of "copying". Ask anyways, does not harm.

> > Yes, but we use AGPLv3, so we are restricting more. > > We will anyway adapt it and not have the exact same code. Reading is also some way of "copying". Ask anyways, does not harm.
synchon commented 2022-10-19 10:21:42 +00:00 (Migrated from github.com)

Yes, but we use AGPLv3, so we are restricting more.

We will anyway adapt it and not have the exact same code.

Reading is also some way of "copying". Ask anyways, does not harm.

Yeah of course.

> > > Yes, but we use AGPLv3, so we are restricting more. > > > > > > We will anyway adapt it and not have the exact same code. > > Reading is also some way of "copying". Ask anyways, does not harm. Yeah of course.
fraimondo (Migrated from github.com) reviewed 2022-10-19 19:22:02 +00:00
synchon commented 2022-10-19 19:24:58 +00:00 (Migrated from github.com)

@fraimondo Okay so I have a basic version working with motivation from datalad. I have kept it focused on our use-case as datalad wtf has a lot of stuff which is better run from there. Let me know what you think. After an initial review, I'll add the tests and it should be good to go.

@fraimondo Okay so I have a basic version working with motivation from datalad. I have kept it focused on our use-case as `datalad wtf` has a lot of stuff which is better run from there. Let me know what you think. After an initial review, I'll add the tests and it should be good to go.
codecov[bot] commented 2022-10-19 19:38:01 +00:00 (Migrated from github.com)

Codecov Report

Merging #33 (80d95cb) into main (f0bccac) will increase coverage by 0.28%.
The diff coverage is 97.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #33      +/-   ##
==========================================
+ Coverage   87.83%   88.11%   +0.28%     
==========================================
  Files          49       50       +1     
  Lines        1866     1910      +44     
  Branches      342      353      +11     
==========================================
+ Hits         1639     1683      +44     
+ Misses        182      181       -1     
- Partials       45       46       +1     
Impacted Files Coverage Δ
junifer/api/utils.py 97.50% <97.50%> (ø)
junifer/api/cli.py 81.96% <100.00%> (+3.01%) ⬆️
# [Codecov](https://codecov.io/gh/juaml/junifer/pull/33?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) Report > Merging [#33](https://codecov.io/gh/juaml/junifer/pull/33?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (80d95cb) into [main](https://codecov.io/gh/juaml/junifer/commit/f0bccac22d96bde003e5f350d78ce345a94a0e12?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) (f0bccac) will **increase** coverage by `0.28%`. > The diff coverage is `97.82%`. [![Impacted file tree graph](https://codecov.io/gh/juaml/junifer/pull/33/graphs/tree.svg?width=650&height=150&src=pr&token=5H21JuZXMw&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml)](https://codecov.io/gh/juaml/junifer/pull/33?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) ```diff @@ Coverage Diff @@ ## main #33 +/- ## ========================================== + Coverage 87.83% 88.11% +0.28% ========================================== Files 49 50 +1 Lines 1866 1910 +44 Branches 342 353 +11 ========================================== + Hits 1639 1683 +44 + Misses 182 181 -1 - Partials 45 46 +1 ``` | [Impacted Files](https://codecov.io/gh/juaml/junifer/pull/33?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml) | Coverage Δ | | |---|---|---| | [junifer/api/utils.py](https://codecov.io/gh/juaml/junifer/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9hcGkvdXRpbHMucHk=) | `97.50% <97.50%> (ø)` | | | [junifer/api/cli.py](https://codecov.io/gh/juaml/junifer/pull/33/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=juaml#diff-anVuaWZlci9hcGkvY2xpLnB5) | `81.96% <100.00%> (+3.01%)` | :arrow_up: |
fraimondo (Migrated from github.com) requested changes 2022-10-20 06:40:46 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
fraimondo (Migrated from github.com) commented 2022-10-20 06:40:24 +00:00

I would go full environment versions here, not only dependencies.

I would go full environment versions here, not only dependencies.
synchon (Migrated from github.com) reviewed 2022-10-20 07:15:55 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
synchon (Migrated from github.com) commented 2022-10-20 07:15:55 +00:00

Ignored built-in modules as it doesn't make sense.

Ignored built-in modules as it doesn't make sense.
fraimondo (Migrated from github.com) reviewed 2022-10-20 15:59:22 +00:00
fraimondo (Migrated from github.com) left a comment

Can we do what I mention in my comment? Or its way too complicated for now?

We can either create a low-priority issue or code it now.

Can we do what I mention in my comment? Or its way too complicated for now? We can either create a low-priority issue or code it now.
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
fraimondo (Migrated from github.com) commented 2022-10-20 15:58:44 +00:00

Can we read this from the pyproject.toml file?

Or we need to manually hardcode here?

I have the impression that it will end-up like the _version.py file, which is created on build/install

Can we read this from the pyproject.toml file? Or we need to manually hardcode here? I have the impression that it will end-up like the `_version.py` file, which is created on build/install
synchon (Migrated from github.com) reviewed 2022-10-20 16:18:42 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
synchon (Migrated from github.com) commented 2022-10-20 16:18:42 +00:00

The only reason I want to avoid reading from pyproject.toml is because of the extra I/O. The dependencies are not going to change frequently so hardcoding it doesn't seem like a bad idea.

I don't really get the analogy with the _version.py though.

The only reason I want to avoid reading from `pyproject.toml` is because of the extra I/O. The dependencies are not going to change frequently so hardcoding it doesn't seem like a bad idea. I don't really get the analogy with the `_version.py` though.
fraimondo (Migrated from github.com) reviewed 2022-10-20 16:24:17 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
fraimondo (Migrated from github.com) commented 2022-10-20 16:24:17 +00:00

On build/install time, a file _dependencies.py is created with an array that contains the dependencies.

Soon, we will start having "conditional" dependencies in which some specific markers will require some dependencies. I'm just trying to avoid having always in mind that we need to manage dependencies in two different sites.

On build/install time, a file `_dependencies.py` is created with an array that contains the dependencies. Soon, we will start having "conditional" dependencies in which some specific markers will require some dependencies. I'm just trying to avoid having always in mind that we need to manage dependencies in two different sites.
fraimondo (Migrated from github.com) reviewed 2022-10-20 16:29:13 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
fraimondo (Migrated from github.com) commented 2022-10-20 16:29:13 +00:00

e.g.: pip install junifer[mri] pip install junifer[eeg] pip install junifer[surf] pip install junifer[dmri] ... etc

e.g.: `pip install junifer[mri]` `pip install junifer[eeg]` `pip install junifer[surf]` `pip install junifer[dmri]` ... etc
synchon (Migrated from github.com) reviewed 2022-10-20 16:39:44 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
synchon (Migrated from github.com) commented 2022-10-20 16:39:44 +00:00

On build/install time, a file _dependencies.py is created with an array that contains the dependencies.

Soon, we will start having "conditional" dependencies in which some specific markers will require some dependencies. I'm just trying to avoid having always in mind that we need to manage dependencies in two different sites.

I don't remember seeing _dependencies.py but will check it.

> On build/install time, a file `_dependencies.py` is created with an array that contains the dependencies. > > Soon, we will start having "conditional" dependencies in which some specific markers will require some dependencies. I'm just trying to avoid having always in mind that we need to manage dependencies in two different sites. I don't remember seeing `_dependencies.py` but will check it.
synchon (Migrated from github.com) reviewed 2022-10-20 16:43:21 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
synchon (Migrated from github.com) commented 2022-10-20 16:43:20 +00:00

e.g.: pip install junifer[mri] pip install junifer[eeg] pip install junifer[surf] pip install junifer[dmri] ... etc

I see what you mean. These conditional dependencies would go in the [project.optional-dependencies] block of the pyproject.toml like we have now for dev and docs. So, the "base" dependencies for example, numpy or nilearn stay the same and we can check for them. But, I agree that maintaining dependencies in two places is a bit troublesome. Let me see if I can find a way to hook into the setuptools or something similar to extract information without requiring extra I/O.

> e.g.: `pip install junifer[mri]` `pip install junifer[eeg]` `pip install junifer[surf]` `pip install junifer[dmri]` ... etc I see what you mean. These conditional dependencies would go in the `[project.optional-dependencies]` block of the `pyproject.toml` like we have now for `dev` and `docs`. So, the "base" dependencies for example, `numpy` or `nilearn` stay the same and we can check for them. But, I agree that maintaining dependencies in two places is a bit troublesome. Let me see if I can find a way to hook into the setuptools or something similar to extract information without requiring extra I/O.
synchon (Migrated from github.com) reviewed 2022-10-21 10:39:31 +00:00
@ -0,0 +1,132 @@
"""Provide utility functions for the api sub-package."""
synchon (Migrated from github.com) commented 2022-10-21 10:39:30 +00:00

Now implemented with an improved regex search.

Now implemented with an improved regex search.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer!33
No description provided.