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

Explain duplicate timestamps #291

Open
pavithraes opened this issue Jun 22, 2024 · 2 comments · May be fixed by #348
Open

Explain duplicate timestamps #291

pavithraes opened this issue Jun 22, 2024 · 2 comments · May be fixed by #348
Labels
part: documentation Improvements/bugs/changes to documentation

Comments

@pavithraes
Copy link
Collaborator

CSP has a many-to-1 mapping between timestamps and engine cycle. This allows for duplication of timestamps in the same engine cycle, for specific use cases. This needs to be documented, potentially in https://github.com/Point72/csp/wiki/Execution-Modes.

An example (shared by rob);

def g():
    u = csp.unroll(csp.const.using(T=[int])([1, 2, 3]))
    s = csp.sample(csp.const(True), u)
    csp.print('u', u)
    csp.print('s', s)
csp.run(g, starttime=datetime(2024, 1, 1))
> 2024-01-01 00:00:00 u:1
> 2024-01-01 00:00:00 s:1
> 2024-01-01 00:00:00 u:2
> 2024-01-01 00:00:00 u:3

csp.unroll is also used in the seismology example

@pavithraes pavithraes added the part: documentation Improvements/bugs/changes to documentation label Jun 22, 2024
@AdamGlustein
Copy link
Collaborator

https://github.com/Point72/csp/wiki/Execution-Modes#csppushmode

Seems like this is appropriately documented.

@robambalu
Copy link
Collaborator

The request here was to document the nuances / gotchas of having dup timestamps, ie in the example mentioned above the sample may not behave the way one would naively expect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: documentation Improvements/bugs/changes to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants