Skip to content

Commit ae9868f

Browse files
authored
Merge pull request #53 from sandialabs/dev-weh
Merging new capabilities
2 parents b6faf55 + c2892c8 commit ae9868f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+7327
-245
lines changed

Diff for: .clang-format

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
22
BasedOnStyle: Google
33
AlignTrailingComments: 'true'
4-
AllowAllParametersOfDeclarationOnNextLine: 'false'
4+
AllowAllArgumentsOnNextLine: 'true'
5+
AllowAllParametersOfDeclarationOnNextLine: 'true'
56
AlwaysBreakTemplateDeclarations: 'Yes'
67
BreakBeforeBraces: Stroustrup
78
ColumnLimit: 100

Diff for: ChangeLog.md

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ Here we list changes of Coek. More detailed information
44
about incremental changes can be found in the [commit
55
history](https://github.com/sandialabs/coek/commits).
66

7+
## 1.5.dev
8+
9+
* coek_utils: Python utilities that work with coek
10+
* coek: Added tictoc and DataPortals logic
11+
* coek: Added new template type utilities
12+
* coek: Using std::to_string to standardize coek tests
13+
* poek: Test updates based on standardized coek test outputs
14+
* pycoek: Various API additions to improve pyomo_coek compatibility with pyomo
15+
* pyomo_coek: Various changes to improve compatibility with pyomo
16+
* pyomo_coek: Added tests for compatibility with pyomo
17+
718
## 1.4
819

920
* Added support for multithreaded model creation.

Diff for: lib/CMakeLists.txt

+17-1
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ if(${with_python})
2929
# Targets for poek testing
3030
#
3131
if(${with_tests})
32-
list(APPEND lib_test_targets "test_poek")
32+
list(APPEND lib_test_targets test_poek test_pyomo test_coek_utils)
3333
add_custom_target(test_poek
3434
COMMAND ${Python_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/poek/poek
3535
)
36+
add_custom_target(test_coek_utils
37+
COMMAND ${Python_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/coek_utils/coek_utils
38+
)
39+
add_custom_target(test_pyomo
40+
COMMAND ${Python_EXECUTABLE} -m pytest ${CMAKE_CURRENT_SOURCE_DIR}/pyomo_coek/pyomo_coek
41+
)
3642
endif()
3743
#
3844
# Targets for poek documentation
@@ -86,6 +92,16 @@ else()
8692
message("Ignoring lib/pyomo_coek")
8793
endif()
8894

95+
message("")
96+
if(${with_python})
97+
message("Configuring lib/coek_utils install")
98+
add_custom_target(pip_install_coek_utils ALL
99+
COMMAND ${Python_EXECUTABLE} -m pip install -e ${CMAKE_CURRENT_SOURCE_DIR}/coek_utils
100+
)
101+
else()
102+
message("Ignoring lib/coek_utils")
103+
endif()
104+
89105
#
90106
# Lib test targets
91107
#

Diff for: lib/coek/coek/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
SET(sources
55
util/index_vector.cpp
66
util/option_cache.cpp
7+
util/tictoc.cpp
78
ast/base_terms.cpp
89
ast/constraint_terms.cpp
910
ast/value_terms.cpp
@@ -45,6 +46,7 @@ if (CMAKE_CXX_STANDARD GREATER_EQUAL 17)
4546
api/variable_array.cpp
4647
api/constraint_map.cpp
4748
api/subexpression_map.cpp
49+
util/DataPortal.cpp
4850
)
4951
endif()
5052

@@ -228,6 +230,8 @@ install(FILES
228230
util/template_utils.hpp
229231
util/sequence.hpp
230232
util/option_cache.hpp
233+
util/DataPortal.hpp
234+
util/tictoc.hpp
231235
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coek/util
232236
)
233237
install(FILES

Diff for: lib/coek/coek/ast/visitor_to_list.cpp

+1-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,7 @@ void visit_MonomialTerm(const expr_pointer_t& expr, std::list<std::string>& repr
7070
auto tmp = safe_pointer_cast<MonomialTerm>(expr);
7171
repr.push_back("[");
7272
repr.push_back("*");
73-
{
74-
std::stringstream sstr;
75-
sstr << tmp->coef;
76-
repr.push_back(sstr.str());
77-
}
73+
repr.push_back(std::to_string(tmp->coef));
7874
if (tmp->var->name.size() == 0) {
7975
// WEH - It's hard to test this logic, since the variable index is dynamically generated
8076
// GCOVR_EXCL_START

Diff for: lib/coek/coek/model/writer_lp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,9 @@ void LPWriter::print_constraint(fmt::ostream& ostr, const Constraint& c, size_t
590590
}
591591
else {
592592
print_repn(ostr, expr, vid);
593-
//CALI_MARK_BEGIN("ELSE");
593+
// CALI_MARK_BEGIN("ELSE");
594594
ostr.print(fmt::format(eq_fmt, lower.value() - tmp));
595-
//CALI_MARK_END("ELSE");
595+
// CALI_MARK_END("ELSE");
596596
}
597597
}
598598

0 commit comments

Comments
 (0)