DynamicsAndNeuralSystems / pyspi

Comparative analysis of pairwise interactions in multivariate time series.
https://time-series-features.gitbook.io/pyspi/
GNU General Public License v3.0
198 stars 26 forks source link

Add octaveless_config.yaml #45

Closed jmoo2880 closed 8 months ago

jmoo2880 commented 8 months ago

Add octaveless_config.yaml file which omits information theoretic SPIs with octave dependencies.

olivercliff commented 8 months ago

Ah Ok. Would it be better to move the import to inside the IIT class, or only try important at the top if the package exists?

On Fri, 22 Dec 2023, 6:43 am Joshua Moore, @.***> wrote:

@.**** commented on this pull request.

In pyspi/octaveless_config.yaml https://github.com/DynamicsAndNeuralSystems/pyspi/pull/45#discussion_r1434439362 :

+# k_search_max: 10 +# tau_search_max: 2 + +# - estimator: gaussian +# k_history: 1 +# l_history: 1 + +# - estimator: symbolic +# k_history: 1 +# l_history: 1 + +# - estimator: symbolic +# k_history: 10 +# l_history: 1 + +# IntegratedInformation:

@olivercliff https://github.com/olivercliff Ah yes, I had initially arrived at this .yaml file by sequentially removing each Information Theoretic SPI until the "Octave missing" error vanished. The motivation for this "octaveless" version was to allow users to skip the computation of SPIs with octave dependence, and continue with a reduced set of the remaining SPIs. Upon closer inspection, it does appear that only the IIT SPIs call on oct2py/octave, but the initialisation of the SPIs from the infotheory module will terminate when attempting to import octave (in the event it doesn't exist), rendering the remainder of the (octave independent) SPIs inaccessible. This explains why commenting out the entire info theory module (and not just IIT SPIs) works without throwing any errors relating to octave.

— Reply to this email directly, view it on GitHub https://github.com/DynamicsAndNeuralSystems/pyspi/pull/45#discussion_r1434439362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMV6ATT67TR7PW5DUF2VA63YKSGPLAVCNFSM6AAAAABA5YDHB6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTOOJTGU3DMNJXGY . You are receiving this because you were mentioned.Message ID: @.***>

jmoo2880 commented 8 months ago

If we wanted to stick with the subset = "octaveless" idea where we use a .yaml with just the IIT SPI commented out, we could do something like a try/except block at the top of the infotheory module which will allow the rest of the classes to be available in the case that octave cannot be imported (and it throws an OSError. This seems like the most straightforward way, but would always require the user specify "octaveless" when instantiating the Calculator. Ideally, it would be great to filter out the SPIs with certain dependencies ahead of time (perhaps using additional keywords?) and give the user an idea of which SPIs will be accessible and which won't (without having to specify an "octaveless" subset for example).

olivercliff commented 8 months ago

I agree that it would probably be best to perhaps throw a warning but continue running otherwise.

There are some other cases in the code where errors are caught and the array is filled with NaNs. Could we do something like that? Send out a warning upon instantiation of the IIT class that it won't work and then return NaNs?

On Fri, 22 Dec 2023, 2:29 pm Joshua Moore, @.***> wrote:

If we wanted to stick with the subset = "octaveless" idea where we use a .yaml with just the IIT SPI commented out, we could do something like a try/except block at the top of the infotheory module which will allow the rest of the classes to be available in the case that octave cannot be imported (and it throws an OSError. This seems like the most straightforward way, but would always require the user specify "octaveless" when instantiating the Calculator. Ideally, it would be great to filter out the SPIs with certain dependencies ahead of time (perhaps using additional keywords?) and give the user an idea of which SPIs will be accessible and which won't (without having to specify an "octaveless" subset for example).

— Reply to this email directly, view it on GitHub https://github.com/DynamicsAndNeuralSystems/pyspi/pull/45#issuecomment-1867189346, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMV6ATTGTMT7UTVTFO5FRP3YKT5DBAVCNFSM6AAAAABA5YDHB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXGE4DSMZUGY . You are receiving this because you were mentioned.Message ID: @.***>