fortran-lang / fftpack

Double precision version of fftpack
https://fortran-lang.github.io/fftpack/
Other
65 stars 18 forks source link

[idea] Introduce stdlib-fpm (forlab) as dev-dependencies in fftpack #12

Closed zoziha closed 2 years ago

zoziha commented 3 years ago

In the process of fftpack for example and testing, routines such as check, is_close, and disp are needed (for convenience). I personally think that it is possible to introduce stdlib-fpm and forlab dependencies only as dev-dependencies.

stdlib-fpm

I have submitted a PR (see https://github.com/fortran-lang/stdlib/pull/508) in stdlib to support the stdlib-fpm branch through github-ci, and now I use LKedward/stdlib-fpm, I think I can switch to fortran-lang/stdlib-fpm in the future. Since fortran-lang/stdlib-fpm is not yet supported, I introduced forlab. When stdlib-fpm is implemented, I will remove forlab.

hilbert transform

I implemented the hilbert transform function in my branch (see add_hilbert), which introduced stdlib-fpm and forlab as dev-dependencies. Using the dev-dependencies feature of fpm means that it is not convenient for us to support the more make test of the make tool in the future.

awvwgk commented 3 years ago

An alternative for getting check from stdlib_error is using the check function from test-drive. Variants of test-drive are already used in fpm, toml-f, and fhash and we are in the progress of porting stdlib's testing to it as well.

If you are interested in trying it out for fftpack let me know. The main issue is of course supporting a Makefile, therefore we had to redistribute it in stdlib, which is not the best way of handling dependencies.

zoziha commented 3 years ago

It seems that test-drive uses object-oriented features and custom derived types, which is a bit complicated for me. I built a mini-test(MIT license) library myself, because I may lack programming experience, and it may not be reasonable enough. In addition, mini-test has borrowed some functions from other libraries, such as stdlib and forlab. I don’t know if there are copyright issues. I want to use mini-test as the test dependency of fftpack, which mainly involves three routines:

public :: check, is_close, disp
[dev-dependencies]
mini-test = { git="https://github.com/zoziha/mini-test.git", branch="mt-fpm" }
hsnyder commented 3 years ago

My preference would be for this repository to have no dependencies. I would be willing to make an exception for stdlib, but only one it has stabilized a little bit more and there's an official release number tag that we can point to as the dependency.

zoziha commented 3 years ago

Is it possible for the fortran-lang organization to develop a Fortran test framework (this is needed when developing code, fpm, stdlib, and fftpack have this requirement)? From my point of view, this is practical and not so difficult, but it needs to be standardized and is widely recognized by the community. Using stdlib-fpm as a test library seems to be a rogue act, stdlib is relatively large, and it is unreasonable to introduce stdlib-fpm just for testing.

certik commented 3 years ago

@zoziha I know @awvwgk had to develop a test framework for stdlib recently. I agree with @hsnyder that it would be nice to keep the dependencies low. I believe Cargo allows to specify dependencies just for tests, that are not used if only the library (without tests) is used. So that might be the way to go.

CC @milancurcic, @LKedward, @everythingfunctional for more feedback.

everythingfunctional commented 3 years ago

fpm also allows to specify dependencies just for tests, so that users of the library will not have to download and compile the things used only for testing.

As for an available Fortran test framework, I have written one (vegetables) and I'm currently in the process of trying to greatly improve the documentation and write a tutorial. I believe @awvwgk also has a standalone version of the framework he developed for stdlib.