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

[Ctypes] TVB-2719 Use ctypes instead of cython #40

Open
wants to merge 12 commits into
base: trunk
Choose a base branch
from

Conversation

ayan-b
Copy link
Member

@ayan-b ayan-b commented Jun 16, 2020

Closes #11 & closes #36

@ayan-b ayan-b changed the title TVB 2719 Use ctypes instead of cython TVB-2719 Use ctypes instead of cython Jun 16, 2020
@liadomide liadomide requested a review from maedoc June 16, 2020 12:03
@liadomide liadomide added this to the GSOC2020 milestone Jun 16, 2020
@ayan-b ayan-b changed the title TVB-2719 Use ctypes instead of cython [WIP] TVB-2719 Use ctypes instead of cython Jun 16, 2020
gdist.py Outdated Show resolved Hide resolved
gdist.py Outdated Show resolved Hide resolved
gdist_c_api.cpp Outdated Show resolved Hide resolved
gdist_c_api.cpp Outdated Show resolved Hide resolved
gdist.py Outdated Show resolved Hide resolved
Copy link
Member

@maedoc maedoc left a comment

Choose a reason for hiding this comment

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

Thanks for this first step towards making the gdist module easier to package and distribute. I would approve and let you choose which of the review points to follow up on, though some will be naturally obligatory, such as using the right DLL extension on different platforms.

@maedoc
Copy link
Member

maedoc commented Jun 16, 2020

A last minor comment: I don't see why C++14 is needed, and it would be easier to not worry about MSVC if you were using C++11 or earlier.

@ayan-b
Copy link
Member Author

ayan-b commented Jun 16, 2020

@maedoc Thanks! The PR is still in WIP and I am working on it.

A last minor comment: I don't see why C++14 is needed, and it would be easier to not worry about MSVC if you were using C++11 or earlier.

I am using range-based for loop (which can easily be changed to standard for loop), so added c++14 to command line arguments.

@codecov
Copy link

codecov bot commented Jun 22, 2020

Codecov Report

❗ No coverage uploaded for pull request base (trunk@106a7b8). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##             trunk      #40   +/-   ##
========================================
  Coverage         ?   81.96%           
========================================
  Files            ?        4           
  Lines            ?      122           
  Branches         ?        0           
========================================
  Hits             ?      100           
  Misses           ?       22           
  Partials         ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 106a7b8...120c1b5. Read the comment docs.

@ayan-b ayan-b changed the title [WIP] TVB-2719 Use ctypes instead of cython TVB-2719 Use ctypes instead of cython Jun 23, 2020
@liadomide
Copy link
Member

These are cosmetics, but:

  • I suggest to have one unit-test comparing the currently computed geodesic matrix of distances with a matrix that was saved from the previous stable version of tvb-gdist (version 2.0.1 for example). Maybe use cortex_16384.zip in this test (then it will need to be committed in data folder).
  • Also, I see the root folder https://github.com/the-virtual-brain/tvb-gdist getting crowded. Could we maybe move some of the files inside geodesic_library ?

@ayan-b
Copy link
Member Author

ayan-b commented Jun 30, 2020

Not really sure why macOS and Windows jobs are failing sometimes with segmentation fault.

@ayan-b
Copy link
Member Author

ayan-b commented Jun 30, 2020

I suggest to have one unit-test comparing the currently computed geodesic matrix of distances with a matrix that was saved from the previous stable version of tvb-gdist (version 2.0.1 for example). Maybe use cortex_16384.zip in this test (then it will need to be committed in data folder).

cortex_16384 takes a lot of time, so I have tested with outer_skull_642, inner_skull_642 and scalp_1082.

Also, I see the root folder https://github.com/the-virtual-brain/tvb-gdist getting crowded. Could we maybe move some of the files inside geodesic_library ?

gdist.pyx, geodesic.py and alternative_geodesic.py can be removed and gdist_c_cpi.h, gdist_c_api.cpp can go inside geodesic_library.

@maedoc
Copy link
Member

maedoc commented Jun 30, 2020

Lia's previous comment about comparing versions is very pertinent. I would also recommend some "synthetic" geometry like a circle and compare distances to known geodesic arc distances.

If you are feeling curious you could even implement something more interesting such as a surface with a known path integral e.g. https://math.stackexchange.com/questions/45089/what-is-the-length-of-a-sine-wave-from-0-to-2-pi

no obligation though really :)

- pip install pytest~=3.6.1
- pytest
- pip3 install nose2 nose2[coverage_plugin]>=0.6.5
- nose2 --with-coverage
Copy link
Member

Choose a reason for hiding this comment

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

I would have a preference to keep using pytest, for consistency with the other TVB builds.
Anyway, nose does not solve the seg fault issue.

Copy link
Member Author

@ayan-b ayan-b Jul 1, 2020

Choose a reason for hiding this comment

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

I am not sure but it appears to be a pytest issue.

Copy link
Member

Choose a reason for hiding this comment

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

why you say it is pytest?
the build are still failing, and tests are not really execute in the latest Travis run.... am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

enthought/comtypes#204 I got this same error. The current failures are due to something else. I am still investigating and will report you back if nose actually fixes the issue.

@ayan-b ayan-b force-pushed the c-source branch 2 times, most recently from 37dec0c to 690db6e Compare July 1, 2020 13:34
@ayan-b ayan-b changed the title TVB-2719 Use ctypes instead of cython [Ctypes] TVB-2719 Use ctypes instead of cython Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commit C source [ctypes] Add Coverage report
3 participants