Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/release_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ jobs:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
macos_dev_target: [12.1, 14.0]
os: [macos-15-intel, macos-14]
include:
- macos_dev_target: 12.1
os: macos-15-intel
- os: macos-15-intel
macos_dev_target: 13.3
allow_failure: false
arch: x86_64
python-arch: x64
pretty: "Mac x64"
- macos_dev_target: 14.0
os: macos-14
- os: macos-14
macos_dev_target: 14.0
Comment on lines +32 to +41

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix mac

allow_failure: false
arch: arm64
python-arch: arm64
Expand Down Expand Up @@ -287,15 +287,15 @@ jobs:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
macos_dev_target: [12.1, 14.0]
os: [macos-15-intel, macos-14]
include:
- macos_dev_target: 12.1
os: macos-15-intel
- os: macos-15-intel
macos_dev_target: 13.3
arch: x86_64
python-arch: x64
test_key: mac12
- macos_dev_target: 14.0
os: macos-14
- os: macos-14
macos_dev_target: 14.0
arch: arm64
python-arch: arm64
test_key: mac14-arm64
Expand Down
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ endif()

project(EnergyPlus)

# Raise an error if attempting to compile on macOS older than 10.15 - it does not work
# Raise an error if attempting to compile on macOS older than 13.3 - it does not work
# 10.15 minimum for std::filesystem, 13.3 minimum for std::format with floating-point (to_chars)
if (APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET not set. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 or greater and try again.")
elseif (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.15")
message(FATAL_ERROR "The minimum required version for macOS is 10.15, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}.")
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET not set. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 13.3 or greater and try again.")
elseif (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "13.3")
message(FATAL_ERROR "The minimum required version for macOS is 13.3, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}.")
Comment on lines +16 to +22

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix mac std::format

endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/PythonInstallCLITools.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

PKGS = {
"energyplus_launch": "3.7.4",
"energyplus_transition_tools": "2.1.4",
"energyplus_transition_tools": "3.0.0",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump here

"ghedesigner": "2.1.1",
}

Expand Down
35 changes: 34 additions & 1 deletion src/EnergyPlus/CommandLineInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ main_gui(True)
exit(0);
});

auto *updaterSubCommand = auxiliaryToolsSubcommand->add_subcommand("updater", "IDF Version Updater");
auto *updaterSubCommand = auxiliaryToolsSubcommand->add_subcommand("updater", "IDF Version Updater GUI");
updaterSubCommand->add_option("args", python_fwd_args, "Extra Arguments forwarded to IDF Version Updater")->option_text("ARG ...");
updaterSubCommand->positionals_at_end(true);
updaterSubCommand->footer("You can pass extra arguments after the updater keyword, they will be forwarded to IDF Version Updater.");
Expand All @@ -274,6 +274,39 @@ main_gui(True)
exit(0);
});

auto *updaterCLISubCommand = auxiliaryToolsSubcommand->add_subcommand("updater-cli", "IDF Version Updater CLI");
updaterCLISubCommand->allow_extras();
updaterCLISubCommand->footer("You can pass extra arguments after the updater-cli keyword, they will be forwarded to IDF Version Updater.\n"
"To get updater-cli's help, invoke without any arguments.");

updaterCLISubCommand->callback([&state, updaterCLISubCommand] {
EnergyPlus::Python::PythonEngine engine(state);
auto const &fwd_args = updaterCLISubCommand->remaining();

std::string cmd = R"python(import sys
sys.argv = ["energyplus auxiliary updater-cli"]

from energyplus_transition.cli import main
main([)python";
if (fwd_args.empty()) {
cmd += "\"--help\"";
} else {
// Unless specifically passed, we pass eplus-dir to the current executable directory, so it doesn't try to auto find in the usual
// installation paths
bool eplus_dir_provided =
std::any_of(fwd_args.begin(), fwd_args.end(), [](const std::string &a) { return a == "-e" || a == "--eplus-dir"; });
if (!eplus_dir_provided) {
cmd += EnergyPlus::format(R"("--eplus-dir", "{}", )", state.dataStrGlobals->exeDirectoryPath.generic_string());
}
for (const auto &arg : fwd_args) {
cmd += EnergyPlus::format("\"{}\", ", arg);
}
}
cmd += "])\n";
engine.exec(cmd);
exit(0);
});

Comment on lines +277 to +309

@jmarrec jmarrec Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New energyplus auxliary updater-cli command

usage: energyplus auxiliary updater-cli [-h] [-e DIR] [-s] [-v] [-p] [-j N] [-t VERSION] IDF_FILE [IDF_FILE ...]                                                                                            
                                                                                                                                                                                                            
Transition EnergyPlus IDF files to a newer version                                                                                                                                                          

positional arguments:
  IDF_FILE              IDF/IMF/lst file(s) to transition

options:
  -h, --help            show this help message and exit
  -e DIR, --eplus-dir DIR
                        EnergyPlus installation directory (auto-detected if omitted)
  -s, --save-intermediate
                        Save intermediate versions during transitioning
  -v, --verbose         Enable verbose output
  -p, --progress        Show a tqdm progress bar
  -j N, --jobs N        Number of parallel workers (default: number of CPUs)
  -t VERSION, --to-version VERSION
                        Stop transitioning at this target version (e.g. 24.2)

Example, with fancy TQDM progress bars:

energyplus auxiliary updater-cli --save-intermediate --progress ~/Downloads/tmp/*.idf
demo_cli

auto *gheDesignerSubCommand = auxiliaryToolsSubcommand->add_subcommand("ghedesigner", "GHEDesigner Operation");
gheDesignerSubCommand->add_option("args", python_fwd_args, "Extra Arguments forwarded to GHEDesigner")->option_text("ARG ...");
gheDesignerSubCommand->positionals_at_end(true);
Expand Down
Loading