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

Optval #139

Merged
merged 13 commits into from
Feb 3, 2020
Merged

Optval #139

merged 13 commits into from
Feb 3, 2020

Conversation

fiolj
Copy link
Contributor

@fiolj fiolj commented Feb 2, 2020

Used template and added complex support and tests to optval

Note: now it seems to work. It is built after changes on common.fypp added in pull request #138 (Added complex to io)

@fiolj fiolj requested review from certik and nshaffer February 2, 2020 15:42
@fiolj fiolj marked this pull request as ready for review February 2, 2020 15:42
Copy link
Contributor

@nshaffer nshaffer left a comment

Choose a reason for hiding this comment

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

Looks pretty solid to me! Only a few minor things stick out in this PR:

  1. Some of the optval tests seemed mislabeled. I think it's helpful when testing templated routines to have the test name match the generated name as closely as possible.
  2. No "test" for complex(sp) loadtxt written. The loadtxt tests hardly count as proper tests, in my opinion, but if you're adding complex(dp), might as well do the single-precision one as well, I think.

Let me know if it all makes sense.

src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/CMakeLists.txt Outdated Show resolved Hide resolved
src/tests/io/test_loadtxt.f90 Outdated Show resolved Hide resolved
src/tests/io/test_loadtxt.f90 Show resolved Hide resolved
src/tests/io/test_loadtxt.f90 Outdated Show resolved Hide resolved
Copy link
Member

@certik certik 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 extracting the optval function into fypp! We definitely want that.

Can you please not do any formatting changes in the same PR? If you want to propose formatting changes, please send a new PR with just those changes. If you could split the formatting changes from this PR, then we can merge it.

(We discussed this already elsewhere --- the formatting changes pollute the PR, so it's lots of unrelated changes that are hard to review if something changed, or if it's just a formatting change.)

@fiolj
Copy link
Contributor Author

fiolj commented Feb 2, 2020 via email

@fiolj
Copy link
Contributor Author

fiolj commented Feb 3, 2020 via email

@fiolj fiolj requested a review from certik February 3, 2020 01:02
Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

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

These are nice improvements. Thank you.
I only look to the changes to optval since the other changes are related to another PR (#138; I guess #138 should be merged before this #139).

Note to anyone who would be happy to do it: a spec stdlib_experimental_optval.md must be added.

src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
Comment on lines 17 to 19
call test_optval_int8
call test_optval_int16
call test_optval_int32
Copy link
Member

Choose a reason for hiding this comment

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

Same proposition here: _int8 ==> _iint8 and so on.

src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
@nshaffer
Copy link
Contributor

nshaffer commented Feb 3, 2020

I added it by mistake. I've not used cmake before. What did confuse me was that stdlib_experimental_io.f90 was there even when it is generated by fypp (and stdlib_experimental_io.fypp is also present a few lines above).

No worries, really this should be automatically handled by CMake, it's just not in place yet.

Copy link
Contributor

@nshaffer nshaffer left a comment

Choose a reason for hiding this comment

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

With @jvdp1's naming suggestions and my little nitpick below, I think optval will be in good shape.

src/tests/optval/test_optval.f90 Outdated Show resolved Hide resolved
src/tests/optval/test_optval.f90 Show resolved Hide resolved
@nshaffer
Copy link
Contributor

nshaffer commented Feb 3, 2020

Note to anyone who would be happy to do it: a spec stdlib_experimental_optval.md must be added.

I have written a spec locally and will submit a PR sometime soon.

Copy link
Member

@certik certik left a comment

Choose a reason for hiding this comment

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

I had to look at the diff locally after merging master into it, and it looks great. Thank you again for simplifying the code.

@certik certik merged commit 9436248 into fortran-lang:master Feb 3, 2020
@fiolj fiolj deleted the optval branch February 4, 2020 11:46
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.

4 participants