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

BUG: Allow tractogram math script to run as such #729

Merged

Conversation

jhlegarreta
Copy link
Contributor

Allow tractogram math script to run as such: without the

if __name__ == "__main__":
    main()

block, the script does simply not call main and does not perform any computation.

Allow tractogram math script to run as such: without the
```
if __name__ == "__main__":
    main()
```

block, the script does simply not call `main` and does not perform any
computation.
@arnaudbore arnaudbore self-requested a review July 2, 2023 21:50
@arnaudbore
Copy link
Contributor

Build passed ! Good Job 🍻 !

@arnaudbore
Copy link
Contributor

Quick question @jhlegarreta : I understand the issue but I don't get any error. Is this a python error ? Which version of python are you using ?

@jhlegarreta
Copy link
Contributor Author

I understand the issue but I don't get any error. Is this a python error ?

I marked it as a BUG because on my end the script does nothing as the main method is not being called. No error or exception is thrown, tests are passing but no actual computation is being made. If you remove the block and put random input arguments, no error will be thrown.

Which version of python are you using ?

Python 3.10.6.

@arnaudbore
Copy link
Contributor

arnaudbore commented Jul 3, 2023

@jhlegarreta even tho this an error, it should work since we have this in setup.py:

            entry_points={
                'console_scripts': ["{}=scripts.{}:main".format(
                    os.path.basename(s),
                    os.path.basename(s).split(".")[0]) for s in SCRIPTS]
            },

How do you install scilpy ? Can you try a fresh install with a new environment ?

@jhlegarreta
Copy link
Contributor Author

How do you install scilpy ?

Followed the instructions; pip install -e .. I'm calling the script from my IDE.

@arnaudbore
Copy link
Contributor

I'm going to merge your PR but the issue comes from the fact you are calling the script from your IDE.

@arnaudbore arnaudbore merged commit 4f6cfe7 into scilus:master Jul 14, 2023
@jhlegarreta
Copy link
Contributor Author

issue comes from the fact you are calling the script from your IDE.

That should not be an issue Arnaud.

@jhlegarreta jhlegarreta deleted the AllowScilTractogramMathToRunAsScript branch July 14, 2023 15:22
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.

2 participants