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

Fixing entry points #10

Merged
merged 1 commit into from
Mar 20, 2024
Merged

Fixing entry points #10

merged 1 commit into from
Mar 20, 2024

Conversation

ns-rse
Copy link

@ns-rse ns-rse commented Dec 9, 2023

Whilst checking up on #9 I was browsing the other issues and thought I might be able to help with #6.

This Pull Request attempts to fix the entry points (also known as Command Line Interface) by...

  • Adding main() functions which instantiate and run the classes defined within and add if __name__ == "__main__:" to run these if the script is called..
  • Changes some of the dependencies (matplotlib) to not be conditional on installing the CLI optional dependencies.
  • Corrects the entry points defined in pyproject.toml to point to each of the main() functions.
(igor2) ❱ pip install -e .
(igor2) ❱ igorbinarywave -f tests/data/mac-double.ibw
5
4
3
2
1
(igor2) ❱ igorpackedexperiment -f tests/data/polar-graphs-demo.pxp
[<UnknownRecord-11 139944549273552>,
 <UnknownRecord-12 139944553167504>,
 <UnknownRecord-13 139944550564240>,
 <UnknownRecord-13 139944549266768>,
 <UnknownRecord-13 139944550696400>,
 <UnknownRecord-13 139944561918096>,
 <UnknownRecord-13 139944549482768>,
 <UnknownRecord-13 139944549486032>,
 <UnknownRecord-13 139944549484816>,
 <UnknownRecord-14 139944561920272>,
 <UnknownRecord-15 139944549492432>,
 <UnknownRecord-16 139944549498448>,
 <UnknownRecord-16 139944549491792>,
 <UnknownRecord-17 139944549496784>,
 <UnknownRecord-17 139944549498704>,
 <UnknownRecord-17 139944549496912>,
 <UnknownRecord-17 139944549497040>,
 <UnknownRecord-17 139944549497232>,
 <UnknownRecord-17 139944549497296>,
 <UnknownRecord-16 139944549497424>,
 <UnknownRecord-17 139944549497552>,
 <UnknownRecord-17 139944549497680>,
 <UnknownRecord-17 139944549497872>,
 <UnknownRecord-17 139944549498512>,
 <UnknownRecord-17 139944549532496>,
 <UnknownRecord-17 139944549532816>,
 <UnknownRecord-18 139944549532112>,
 <UnknownRecord-11 139944549532176>,
 <UnknownRecord-26 139944549531984>,
 <UnknownRecord-26 139944549533072>,
 <VariablesRecord 139944549532944>,
 <HistoryRecord 139944549536208>,
 <WaveRecord 139944549536528>,
 <WaveRecord 139944549361232>,
 <WaveRecord 139944552677264>,
 <WaveRecord 139944558782928>,
 <WaveRecord 139944551312848>,
 <WaveRecord 139944552724496>,
 <WaveRecord 139944578160784>,
 <WaveRecord 139944548687696>,
 <FolderStartRecord 139944560740304>,
 <FolderStartRecord 139944561017296>,
 <VariablesRecord 139944549535312>,
 <FolderEndRecord 139944549482640>,
 <FolderStartRecord 139944548760272>,
 <VariablesRecord 139944561920208>,
 <FolderEndRecord 139944548686224>,
 <FolderEndRecord 139944556294736>,
 <RecreationRecord 139944548890320>,
 <GetHistoryRecord 139944549546960>,
 <ProcedureRecord 139944554896400>]

I'm not sure if this is the expected output but the entry points work in some manner. I couldn't work out the difference between the test data files (I'm on GNU/Linux rather than OSX/Windows).

However, I don't think this should be the final solution as there is still a dependency on the original igor as the Script module is imported and it would make more sense to have the entry points defined wholly within igor2.

I've put place holders for testing the entry points until a decision is made on how to proceed.

Whilst checking up on AFM-analysis#9 I was browsing the other issues and thought I might be
Work related to AFM-analysis#6

Fixes the entry points (also known as Command Line Interface) by...

* Adding `if __name__ == "__main__:"` to each of the `cll.*` submodules to instantiate and run the classes defined
  within.
* Changes some of the dependencies (`matplotlib`) to not be conditional on installing the CLI optional dependencies.
* Corrects the entry points defined in `pyproject.toml`

```bash
(igor2) ❱ pip install -e .
(igor2) ❱ igorbinarywave -f tests/data/mac-double.ibw
5
4
3
2
1
(igor2) ❱ igorpackedexperiment -f tests/data/polar-graphs-demo.pxp
[<UnknownRecord-11 139944549273552>,
 <UnknownRecord-12 139944553167504>,
 <UnknownRecord-13 139944550564240>,
 <UnknownRecord-13 139944549266768>,
 <UnknownRecord-13 139944550696400>,
 <UnknownRecord-13 139944561918096>,
 <UnknownRecord-13 139944549482768>,
 <UnknownRecord-13 139944549486032>,
 <UnknownRecord-13 139944549484816>,
 <UnknownRecord-14 139944561920272>,
 <UnknownRecord-15 139944549492432>,
 <UnknownRecord-16 139944549498448>,
 <UnknownRecord-16 139944549491792>,
 <UnknownRecord-17 139944549496784>,
 <UnknownRecord-17 139944549498704>,
 <UnknownRecord-17 139944549496912>,
 <UnknownRecord-17 139944549497040>,
 <UnknownRecord-17 139944549497232>,
 <UnknownRecord-17 139944549497296>,
 <UnknownRecord-16 139944549497424>,
 <UnknownRecord-17 139944549497552>,
 <UnknownRecord-17 139944549497680>,
 <UnknownRecord-17 139944549497872>,
 <UnknownRecord-17 139944549498512>,
 <UnknownRecord-17 139944549532496>,
 <UnknownRecord-17 139944549532816>,
 <UnknownRecord-18 139944549532112>,
 <UnknownRecord-11 139944549532176>,
 <UnknownRecord-26 139944549531984>,
 <UnknownRecord-26 139944549533072>,
 <VariablesRecord 139944549532944>,
 <HistoryRecord 139944549536208>,
 <WaveRecord 139944549536528>,
 <WaveRecord 139944549361232>,
 <WaveRecord 139944552677264>,
 <WaveRecord 139944558782928>,
 <WaveRecord 139944551312848>,
 <WaveRecord 139944552724496>,
 <WaveRecord 139944578160784>,
 <WaveRecord 139944548687696>,
 <FolderStartRecord 139944560740304>,
 <FolderStartRecord 139944561017296>,
 <VariablesRecord 139944549535312>,
 <FolderEndRecord 139944549482640>,
 <FolderStartRecord 139944548760272>,
 <VariablesRecord 139944561920208>,
 <FolderEndRecord 139944548686224>,
 <FolderEndRecord 139944556294736>,
 <RecreationRecord 139944548890320>,
 <GetHistoryRecord 139944549546960>,
 <ProcedureRecord 139944554896400>]
```

I'm not sure if this is the expected output but the entry points work in some manner. I couldn't work out the difference
between the test data files (I'm on GNU/Linux rather than OSX/Windows).

However, I don't think this should be the final solution as there is still a dependency on the original `igor` as the
[`Script`](https://github.com/wking/igor/blob/master/igor/script.py) module is imported and it would make more sense to
have the entry points defined wholly within `igor2`.
janberges added a commit to janberges/igor2 that referenced this pull request Mar 16, 2024
This fix has already been included in slackline's commit "Fixing entry points",
see pull request AFM-analysis#10 by ns-rse.
janberges added a commit to janberges/igor2 that referenced this pull request Mar 16, 2024
This fix has also been included in slackline's commit "Fixing entry points",
see pull request AFM-analysis#10 by ns-rse.
@janberges janberges mentioned this pull request Mar 16, 2024
@paulmueller
Copy link
Member

Sorry, I did not subscribe to pull requests, so this one slipped me. Will take a look this week.

Copy link
Member

@paulmueller paulmueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay.

@paulmueller paulmueller merged commit f34ca9b into AFM-analysis:master Mar 20, 2024
@paulmueller paulmueller mentioned this pull request Mar 20, 2024
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.

3 participants