Fortran - Protein-Translation (exercise)

I would like to add the 48in24 W5 exercise Protein-Translation to the Fortran track.

I’m not sure how to best handle invalid codon errors, so I simply went with returning an empty list.


Not completely related, but while testing the example implementation I noticed, that aborting execution using a STOP statement seems to automatically pass the assert_equal tests.

If it’s too unwieldy, you could just not include the test and mark it as not included in the metadata.toml.

I don’t think it’s necessarily unwieldy, but maybe conceptually not great.

But also looking at how this is handled in other tracks (e.g. C++), instead of imposing a suboptimal way of dealing with invalid codons, simply removing the corresponding tests is probably better.

I agree with removing the tests, that seems like a better option.

@D3usXMachina I can’t seem to re-open the pull request. Could you re-create the PR (sorry!)?

@ErikSchierboom I created a new PR #245. The tests with invalid codons are now removed, and the changes to the testlib are also included.

Sorry, I’m new to this, so I might have set some settings wrong.
Is there a way to link to the forum discussion in order to avoid having the PR automatically closed?

There isn’t. We have to manually re-open the PR.

Just bumping this because the exercise is up next week. Could someone familiar with the Fortran track review 242 so that we could get 242 and 245 merged in time?

I noticed that the example solution I provided, while passing the CI, crashes when submitted on the website.

Is there a possibility to get more detailed logs than

An error occurred while running your tests. This might mean that there was an issue in our infrastructure, or it might mean that you have something in your code that's causing our systems to break.

Please check your code, and if nothing seems to be wrong, try running the tests again.

When I test this locally, I get:

/tmp/protein-translation/protein_translation_test.f:::

     |   call assert_equal([character(len=) ::], proteins(), Empty RNA sequence results in no proteins)
      |                                                                                                      
Error: There is no specific subroutine for the generic assert_equal at ()
/tmp/protein-translation/protein_translation_test.f:::

I see. Just to be sure I made a fresh clone and it works fine on my machine. Could you tell me what version of gfortran you are using?

I think a quick but not so beautiful fix might be to make the assert_equal_str_arr function public and use it explicitly.
I’ll download the docker image when I have the time and test it there.

I’m testing using the fortran test runner, so whatever version is being used there.