Conversation
added 2 commits
February 23, 2026 13:30
added 4 commits
February 23, 2026 14:02
- Updated exception constructors in ffi_core.hpp for consistent formatting. - Enhanced check_status function for better readability and structure. - Rearranged include directives in period.hpp and tempoch.hpp for clarity. - Improved formatting and consistency in time.hpp, including UTC, JulianDate, and MJD classes. - Updated test cases in main.cpp, test_period.cpp, and test_time.cpp for consistent formatting and improved readability. - Updated submodule reference for qtty-cpp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor of the
Periodclass, making it a generic template that supports multiple time types (MJD, JulianDate, UTC) instead of only MJD. It also integrates the externalqtty-cpplibrary to provide type-safe time quantities and unit conversions, and adds streaming operators for improved output formatting. The examples and tests have been updated to use the new generic API and to demonstrate unit conversions.The most important changes are:
1. Period Class Refactor and Generalization
Periodinto a class templatePeriod<T>, allowing periods to be expressed in MJD, JulianDate, or UTC, with conversions handled by newTimeTraitsspecializations. This removes ambiguity and makes the API more robust and flexible. (include/tempoch/period.hpp,examples/time_example.cpp,tests/test_period.cpp) [1] [2] [3] [4] [5]2. Integration of qtty-cpp for Type-Safe Units
qtty-cppas a submodule and linked it in the build system. ThePeriodclass now provides aduration()method that returns aqtty::Quantityand supports unit conversions (e.g., days, hours, seconds), improving type safety and clarity. (.gitmodules,CMakeLists.txt,include/tempoch/period.hpp,examples/time_example.cpp,tests/test_period.cpp,qtty-cpp) [1] [2] [3] [4] [5]3. Improved Output Formatting
operator<<overloads forMJD,JulianDate,UTC, and genericPeriod<T>to enable direct and consistent streaming to output streams, simplifying example and test code. (include/tempoch/time.hpp,include/tempoch/period.hpp,examples/time_example.cpp) [1] [2] [3] [4]4. Updates to Examples and Tests
Period<T>API, demonstrate unit conversions, and use the new streaming operators. Added new tests for duration in different units. (examples/time_example.cpp,tests/test_period.cpp) [1] [2] [3]5. Build System and Dependency Updates
CMakeLists.txtto add and link theqtty-cppsubmodule, ensuring the new dependency is included in the build. (CMakeLists.txt,.gitmodules) [1] [2]These changes make the time period API more expressive, type-safe, and easier to use, while improving output formatting and extensibility.