Skip to content

Composite value class #11

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 10 commits into from
Feb 5, 2024
Merged

Composite value class #11

merged 10 commits into from
Feb 5, 2024

Conversation

php1ic
Copy link
Owner

@php1ic php1ic commented Feb 5, 2024

Wrap a measured value in a class so we can keep the value and error/uncertainty together.

Use std::optional so we can be 'modern' and not have to use magic numbers to signify error states.

php1ic added 10 commits August 6, 2023 13:45
After adding the Number class, initialisation and general access needs
to be updated and the tests modified.
By wrapping in a lambda the type can be changed in the future in a
single place.
As we use the value immediately, call the function as the argument.
I'm running 16.0.6 locally, but the github runner is 14.0.0 and giving
compiler errors.
```
In file included from /home/runner/work/nuclear-data-reader/nuclear-data-reader/src/ame_data.cpp:1:
In file included from /home/runner/work/nuclear-data-reader/nuclear-data-reader/include/nuclear-data-reader/ame_data.hpp:15:
In file included from /home/runner/work/nuclear-data-reader/nuclear-data-reader/include/nuclear-data-reader/converter.hpp:22:
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression
        static constexpr unsigned fractional_width = {_S_fractional_width()};
                                                      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: note: undefined function '_S_fractional_width' cannot be used in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2275:2: note: declared here
        _S_fractional_width()
        ^
1 error generated.
```
Try using the latest version of clang available to jammy.
Copy link

codecov bot commented Feb 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4ea0987) 99.07% compared to head (8750e79) 99.08%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #11   +/-   ##
=======================================
  Coverage   99.07%   99.08%           
=======================================
  Files          14       15    +1     
  Lines         971      979    +8     
=======================================
+ Hits          962      970    +8     
  Misses          9        9           
Files Coverage Δ
include/nuclear-data-reader/ame_data.hpp 100.00% <100.00%> (ø)
include/nuclear-data-reader/converter.hpp 100.00% <ø> (ø)
include/nuclear-data-reader/nubase_data.hpp 100.00% <100.00%> (ø)
include/nuclear-data-reader/number.hpp 100.00% <100.00%> (ø)
src/ame_data.cpp 100.00% <100.00%> (ø)
src/isotope.cpp 100.00% <100.00%> (ø)
src/nubase_data.cpp 99.18% <100.00%> (ø)

@php1ic php1ic merged commit 2a44c0c into master Feb 5, 2024
@php1ic php1ic deleted the composite_value branch February 5, 2024 12:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant