Skip to content

Conversation

@ocots
Copy link
Member

@ocots ocots commented Dec 17, 2025

Issue #169.

- Refactor test/runtests.jl to use CTBase.run_tests with glob patterns
- Add test/coverage.jl for coverage post-processing
- Extract docs/api_reference.jl following CTBase pattern
- Refactor docs/make.jl with DocumenterReference.reset_config()
- Fix test/io/test_ext_exceptions.jl to use dummy types for stub testing
- Update .gitignore for test output files
@ocots ocots linked an issue Dec 17, 2025 that may be closed by this pull request
@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

Breakage test results
Date: 2025-12-17 17:17:36

Name Latest Stable
CTDirect compat: v0.6.9 compat: v0.6.9
CTFlows compat: v0.6.9 compat: v0.6.9
OptimalControl compat: v0.6.9 compat: v0.6.9

@ocots
Copy link
Member Author

ocots commented Dec 17, 2025

🎯 Action Plan: PR #242 - Naming and Consistency Planning for CTModels.jl

Date: 2025-12-17
PR: #242 by @ocots | Branch: 169-dev-naming-and-consistencymain
State: OPEN | Linked Issue: #169


📋 Overview

Issue Summary: Issue #169 "[Dev] Naming and consistency" requests adding alias functions so both is_* and has_* naming conventions are available for boolean predicates.

PR Summary: This PR implements:

  1. Infrastructure standardization: TestRunner refactoring, API reference modularization.
  2. Naming consistency aliases:
    • Time aliases in src/ocp/times.jl
    • Cost aliases in src/ocp/objective.jl
    • (Note: Autonomy alias was removed as it's not semantically equivalent to autonomous dynamics in OCP context)
    • Tests for all new aliases

Status: ✅ Implementation Complete - All tests passing


🎯 Implementation Completed

✅ T1: Time aliases in src/ocp/times.jl

Added const aliases after the existing functions:

const is_initial_time_fixed = has_fixed_initial_time
const is_initial_time_free = has_free_initial_time
const is_final_time_fixed = has_fixed_final_time
const is_final_time_free = has_free_final_time

✅ T2: Cost aliases in src/ocp/objective.jl

Added const aliases for cost definitions:

const is_mayer_cost_defined = has_mayer_cost
const is_lagrange_cost_defined = has_lagrange_cost

❌ T3: Autonomy alias (CANCELLED)

Removed has_autonomous_dynamics alias and its tests, as "being autonomous" for an OCP is not strictly equivalent to having autonomous dynamics.

✅ T4: Aliases work for all types

Since const creates a true alias, the new names automatically work with all existing methods including those for Model type.

✅ T5: No exports needed

The module uses qualified access (CTModels.function_name), no explicit exports.

✅ T6: Docstrings and Tests added

  • test/ocp/test_times.jl: Added testset "times: is_* naming aliases" (+16 tests)
  • test/ocp/test_objective.jl: Added testset "cost aliases" (+12 tests)

🧪 Test Status

Overall: ✅ All 2837 tests passing

Local Test Results:

Test Summary:                      | Pass  Total     Time
CTModels tests                     | 2837   2837  1m20.2s
  ocp/test_times.jl                |   63     63     0.5s
  ocp/test_objective.jl            |   46     46     0.3s
  ocp/test_time_dependence.jl      |    6      6     0.1s

📂 Files Modified

File Changes
src/ocp/times.jl Added 4 time aliases + docstrings
src/ocp/objective.jl Added 2 cost aliases + docstrings
test/ocp/test_times.jl Added tests for time aliases
test/ocp/test_objective.jl Added tests for cost aliases

💡 Next Steps

  1. Commit changes: The implementation is complete and verified.
  2. Push to PR: Update the PR with the new commits.
  3. Wait for CI: Ensure all CI checks pass.
  4. Merge: Once CI is green, the PR can be merged to close issue [Dev] Naming and consistency #169.

Added is_* style aliases for time predicates:
- is_initial_time_fixed, is_initial_time_free
- is_final_time_fixed, is_final_time_free

Added is_* style aliases for cost definitions:
- is_mayer_cost_defined
- is_lagrange_cost_defined

These aliases improve consistency between has_* and is_* naming conventions.
Also included corresponding regression tests.
@ocots ocots merged commit 9a7438d into main Dec 17, 2025
20 checks passed
@ocots ocots deleted the 169-dev-naming-and-consistency branch December 17, 2025 17:25
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.

[Dev] Naming and consistency

2 participants