Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce use of Array1S objects #7813

Merged
merged 17 commits into from
Mar 2, 2020
Merged

Reduce use of Array1S objects #7813

merged 17 commits into from
Mar 2, 2020

Conversation

jasondegraw
Copy link
Member

@jasondegraw jasondegraw commented Feb 26, 2020

Pull request overview

Reduces the use of the Array1S object, generally replacing the Array1S with a reference to an Array1D object. This PR mainly removes non-slicing uses of the object, leaving in place 2D to 1D slicing and other similar uses. The changes here should result in no diffs. This is part of the larger effort to migrate to std::vector.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Check any new function arguments for performance impacts

@jasondegraw jasondegraw added the Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring label Feb 26, 2020
@jasondegraw jasondegraw added this to the EnergyPlus 9.3.0 milestone Mar 1, 2020
@mitchute
Copy link
Collaborator

mitchute commented Mar 2, 2020

No problems that I see. This looks ready.

Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

I was expecting to see at least some unit test code change to accommodate this, but I get that it shouldn't really be necessary, so this is fine. You are touching a lot of code that is unit tested already, so I'd expect to see lots of failures if you broke something. I have questions about the code you changed, but not the changes you made, just some 🤦‍♂️ when looking at the original code.

This is good to go by me. Develop has now moved a little, so I can pull this branch and merge in develop and run some quick tests locally.

)
{

// SUBROUTINE INFORMATION:
// AUTHOR Linda Lawrie
// DATE WRITTEN May 2005
// MODIFIED na
// MODIFIED Jason DeGraw 2/12/2020, de-optionalized
Copy link
Member

Choose a reason for hiding this comment

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

requirized?

@@ -599,7 +599,7 @@ namespace DataEnvironment {
ShowFatalError("Program terminates due to preceding condition(s).");
}

void SetWindSpeedAt(int const NumItems, Array1S<Real64> const Heights, Array1S<Real64> LocalWindSpeed, std::string const &EP_UNUSED(Settings))
void SetWindSpeedAt(int const NumItems, const Array1D<Real64> &Heights, Array1D<Real64> &LocalWindSpeed, std::string const &EP_UNUSED(Settings))
Copy link
Member

Choose a reason for hiding this comment

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

Why is this an array anyway? Not your problem, just rambling...

@@ -3047,7 +3047,6 @@ namespace SimulationManager {
EndUses,
Groups,
VarNames,
_,
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar
Copy link
Member

Tested locally, looking good. Merging.

@Myoldmopar Myoldmopar merged commit d4756d0 into develop Mar 2, 2020
@Myoldmopar Myoldmopar deleted the array1s-removal branch March 2, 2020 21:56
@jasondegraw jasondegraw mentioned this pull request Mar 4, 2020
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactoring Includes code changes that don't change the functionality of the program, just perform refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants