Bugfix/plot without friction - #55
Conversation
|
|
|
|
||
| result = plot_cpt.check_data_availability_for_plotting(cpt, "friction_nbr") | ||
|
|
||
| assert result is True |
There was a problem hiding this comment.
can you also correct the rest of the asserts to assert result, instead of assert result is True
| def test_check_data_availability_qc_raises_value_error_without_tip(self): | ||
| """ | ||
| Test that check_data_availability_for_plotting raises ValueError with correct message | ||
| when tip data is not available for qc plotting | ||
| """ | ||
| cpt = BroXmlCpt() | ||
| cpt.tip = None | ||
|
|
||
| with pytest.raises( | ||
| ValueError, | ||
| match="Tip data is not available for plotting, this is required for plotting.", | ||
| ): | ||
| plot_cpt.check_data_availability_for_plotting(cpt, "qc") |
There was a problem hiding this comment.
this test is a duplicate
| """ | ||
| cpt = BroXmlCpt() | ||
|
|
||
| result = plot_cpt.check_data_availability_for_plotting(cpt, "unknown_key") |
There was a problem hiding this comment.
this behaviour is a bit strange, why would a unknown key return True
There was a problem hiding this comment.
yes good point
| pdf.close() | ||
|
|
||
|
|
||
| def check_data_availability_for_plotting(cpt: AbstractCPT, key) -> bool: |
There was a problem hiding this comment.
I think its better to invert the if statements here, i.e. if key == "something" and cpt.something is not None, return true. but default value false. so unavailable keys also return false
There was a problem hiding this comment.
ok changed the function
|
|
||
| # Check that a PDF file was created | ||
| pdf_files = list(output_dir.glob("*.pdf")) | ||
| assert len(pdf_files) > 0, "No PDF file was created" |
There was a problem hiding this comment.
this comment doesnt seem right
Co-authored-by: aronnoordam <51492202+aronnoordam@users.noreply.github.com>
Co-authored-by: aronnoordam <51492202+aronnoordam@users.noreply.github.com>
Co-authored-by: aronnoordam <51492202+aronnoordam@users.noreply.github.com>
|
|



In this issue the plot is not generated if there is not a value of friction and/or friction number. This is not the functionality we want. What I changed is that the tip resistance ( and depth) is the only parameter that is required for the plottting