Skip to content

Commit

Permalink
Merge pull request #9349 from NREL/FixEPLaunchPythonImport
Browse files Browse the repository at this point in the history
Use epin variable properly for EPLaunch
  • Loading branch information
Myoldmopar authored Mar 28, 2022
2 parents 4ba5fb3 + 31784d6 commit fa02272
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
12 changes: 6 additions & 6 deletions release/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ <h2><a id="Multiple_Version_Conversions_51"></a>Multiple Version Conversions</h2
version (including .rvi and .mvi files) to the current version. The install also includes the necessary programs
to convert from older versions back to v7.2.0. For versions older than v7.2.0, first we applaud your dedication
to EnergyPlus that stretches for quite some time, and second you will need to visit the
helpdesk (<a href="https://energyplushelp.freshdesk.com/">energyplushelp.freshdesk.com</a>) to request multiple
conversion set of programs.
<a href="https://energyplushelp.freshdesk.com/support/solutions/folders/67000241428">Helpdesk</a> to request
multiple conversion set of programs.
</p>

<h2><a id="Documentation_55"></a>Documentation</h2>
Expand Down Expand Up @@ -230,7 +230,7 @@ <h2><a id="Weather_Data_63"></a>Weather Data</h2>
EnergyPlus uses these files directly for annual simulations. The Weather Converter program that is part of
EnergyPlus can read these weather files and provide .csv (comma separated variable) as well as statistics
reports
about the included (or other) files. Weather data for more than 2100 locations in more than 100 countries can be
about the included (or other) files. Weather data for more than 3000 locations in more than 100 countries can be
downloaded on the <a href="https://energyplus.net/weather">EnergyPlus Weather Page</a>.</p>

<h2>Highlights of this release (V22.1.0)</h2>
Expand Down Expand Up @@ -386,13 +386,13 @@ <h2><a id="Platforms_90"></a>Platforms</h2>
Packages changed slightly as of the 9.4 release.
We began building our packages on a new system which adds better support
for newer platforms. During the change, we stepped away from some older OS versions. For example, we are
not testing on Windows 7 or 8, only 10. However, both our 32-bit and 64-bit packages now include the new
not testing on Windows 7 or 8, only 10 and 11. However, both our 32-bit and 64-bit packages now include the new
Python plugin system, rather than just the 64-bit as previously. We have also added packaging and testing
with Ubuntu 20.04 <i>in addition to</i> Ubuntu 18.04. On Mac, we are officially releasing an installer for
OSX 10.15 and moving toward OSX 11 as well.
</p>
<ul class="list-group">
<li class="list-group-item">Windows 10</li>
<li class="list-group-item">Windows 10 and 11</li>
<li class="list-group-item">Linux (Ubuntu 18.04 and 20.04) 64 bit versions</li>
<li class="list-group-item">Mac OSX 10.15 64 bit versions</li>
<li class="list-group-item">EnergyPlus V22.1 has been tested on all of these platforms</li>
Expand All @@ -413,7 +413,7 @@ <h2><a id="Known_problems_104"></a>Known problems</h2>
known (and even more unknown) probably remain. Specifics on the remaining known problems can be found on the
GitHub repository <a href="https://github.com/NREL/EnergyPlus/issues">issues page</a>. If you are interested in
what has been addressed, the issues resolved in this release are installed similarly in the
<a href="changelog.html">changelog</a>.
<a href="https://github.com/NREL/EnergyPlus/releases/latest">release details</a>.
</p>

<h2>Additional steps you may want to consider:</h2>
Expand Down
20 changes: 18 additions & 2 deletions src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,9 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s
state,
"PluginManager: Search path inputs requested adding epin variable to Python path, but epin variable was empty, skipping.");
} else {
if (FileSystem::pathExists(epinPathObject)) {
fs::path sanitizedEnvInputDir = PluginManager::sanitizedPath(epinPathObject);
auto epinRootDir = FileSystem::getParentDirectoryPath(fs::path(epinPathObject));
if (FileSystem::pathExists(epinRootDir)) {
fs::path sanitizedEnvInputDir = PluginManager::sanitizedPath(epinRootDir);
PluginManager::addToPythonPath(state, sanitizedEnvInputDir, true);
} else {
EnergyPlus::ShowWarningMessage(state,
Expand All @@ -541,6 +542,21 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s
// nothing to do here
}
}
} else {
// if no search path objects exist, we still need to do the default searching
PluginManager::addToPythonPath(state, ".", false);
fs::path sanitizedInputFileDir = PluginManager::sanitizedPath(state.dataStrGlobals->inputDirPath);
PluginManager::addToPythonPath(state, sanitizedInputFileDir, false);
std::string epin_path;
get_environment_variable("epin", epin_path);
fs::path epinPathObject = fs::path(epin_path);
if (!epinPathObject.empty()) {
auto epinRootDir = FileSystem::getParentDirectoryPath(fs::path(epinPathObject));
if (FileSystem::pathExists(epinRootDir)) {
fs::path sanitizedEnvInputDir = PluginManager::sanitizedPath(epinRootDir);
PluginManager::addToPythonPath(state, sanitizedEnvInputDir, true);
}
}
}

// Now read all the actual plugins and interpret them
Expand Down

4 comments on commit fa02272

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2508 of 2508 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2486 of 2486 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1744 of 1744 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (746 of 746 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.