question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`getTimeStepNum` is wrong

See original GitHub issue

In /utils there is a little function getTimeStepNum: https://github.com/terrapower/armi/blob/a857635c4f91147805117d57ac5fa3fa93374a1a/armi/utils/__init__.py#L79-L89

This function is buggy. For instance, consider an evenly-spaced cycle history defined in some cs with burnSteps: 3 nodalized as such:

image

If a user were to call getTimeStepNum(2, 2, cs), they would get 2*4 + 2 = 10, which is clearly incorrect. From my understanding, the answer should be 8.

It is also a bit ambiguous what should be returned by this function. Particularly on nodes that are at the beginning/end of a cycle. For instance, is an EOC node associated with the time step that came before, the time step that comes after (which is not clearly defined), or nothing at all?

Looking through the framework, it appears to only be used in a test for the historyTracker, which apparently isn’t even supported anyways. And then looking through our internal codes, I only see it being used one single time (in Crucible @sammiller11235 ).

So what do we want to do with this little bugger? I’m happy to make the changes myself as part of #637 , but don’t know exactly how to resolve it.

Personally I would advocate getting rid of it entirely and replacing it with a function more like getTimeNodeNum, which would be well defined.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kecklercommented, May 2, 2022

Okay, I agree with that, thanks @sammiller11235 for making that clear.

I think then that it would make sense to change the name of this function so that its intent is more clear. Especially since the docstring also refers to "timestep"s, I think it should be clarified.

Any complaints on that approach? If not, I’ll go ahead and do it.

1reaction
sammiller11235commented, Apr 30, 2022

I think this is actually functioning as intended, although the semantics of it could probably be improved. Because ARMI stores data at both the “EOC” and “BOC” as separate “nodes”, there is actually an additional index involved. In your figure above, you show (0,3) and (1,0) as the same thing, but in the ARMI database, these are two distinct “nodes”. Even though there was not a “burnStep” to go between the two, if you were simply indexing the number of storage locations in the ARMI database, there would be 10 indices (for (2,2)). The wording “timeStep” is the problem, as the time has not increased. It might be better described as “getNumberOfDatabaseIndices” or similar

Read more comments on GitHub >

github_iconTop Results From Across the Web

momentJS: Getting wrong timestamp from date in a different ...
I am trying to get timestamp in milliseconds for these inputs let start_time = "17:05:00"; var start_date_moment = moment(start_time, ...
Read more >
Current Timestamp shows wrong time - MSDN - Microsoft
Current Timestamp command shows wrong time. ... Type TIME with no parameters to display the current time setting and a prompt for a...
Read more >
Wrong time inserted in a timestamp column — oracle-tech
Best Answer​​ LOCALTIMESTAMP returns the current date and time in the session time zone in a value of datatype TIMESTAMP . The difference...
Read more >
Forms Timestamp is wrong time zone - Google Support
Forms is updating a google sheet with the answers, but the timestamp is wrong. I tried checking the settings on the sheet, and...
Read more >
Current timestamp. Incorrect time - Emacs Stack Exchange
Linux, Emacs 27.2. I want in org file to insert current data and time. Now in my machine is 02 June 10:56 AM....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found