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

Sum amount of concurrent pilots per time sample #31

Open
mturilli opened this issue Feb 21, 2017 · 3 comments
Open

Sum amount of concurrent pilots per time sample #31

mturilli opened this issue Feb 21, 2017 · 3 comments
Assignees
Labels

Comments

@mturilli
Copy link
Contributor

When measuring pilot concurrency, sampling returns all the timestamps within the sampling rate. For example:

session.concurrency(state=['PMGR_ACTIVE', ['DONE', 'CANCELED', 'FAILED']], sampling=60)
 	timestamp 	npilot
0 	3.9303 	 1
1 	4.4225 	 1
2 	4.8275 	 1
3 	5.3653 	 1
4 	5.5524 	 1
5 	5.6212 	 1
6 	5.8381 	 1
7 	6.0298 	 1
8 	6.1350 	 1
9 	6.7833 	 1
10 	7.8033 	 1
11 	63.9303  1
12 	64.4225  1
13 	64.8275  1
14 	65.3653  2
15 	65.5524  1
16 	65.6212  1
17 	65.8381  2
18 	66.0298  2
19 	66.1350  1
20 	66.7833  2
21 	67.8033  2
22 	123.9303 1

When plotting this timeseries, it would be useful to have the total amount of entities in the specified state for the chosen time sample. For example:

1    60     11
2    120    16
...
@andre-merzky
Copy link
Member

Hmm, this is actually what the sampling should do already, so this is a bug. thx!

@andre-merzky andre-merzky self-assigned this Feb 21, 2017
@andre-merzky andre-merzky added bug and removed feature labels Feb 21, 2017
@mturilli
Copy link
Contributor Author

As a side note, this is done by the resample method in pandas:

>>> series
2000-01-01 00:00:00    0
2000-01-01 00:01:00    1
2000-01-01 00:02:00    2
2000-01-01 00:03:00    3
2000-01-01 00:04:00    4
2000-01-01 00:05:00    5
2000-01-01 00:06:00    6
2000-01-01 00:07:00    7
2000-01-01 00:08:00    8

>>> series.resample('3T', label='right', closed='right').sum()
2000-01-01 00:00:00     0
2000-01-01 00:03:00     6
2000-01-01 00:06:00    15
2000-01-01 00:09:00    15

@ibethune ibethune added this to the 0.46 milestone Mar 2, 2017
@andre-merzky
Copy link
Member

andre-merzky commented May 25, 2017

Sorry that this took so long to look into! To me it looks like the sample parameter to the session.concurrency() method does exactly what you are asking for. Like, I get reasonable output with different sample values for code like this:

    units = session.filter(etype='unit', inplace=False)
    conc = units.concurrency(state=[rp.AGENT_EXECUTING,
                                    rp.AGENT_STAGING_OUTPUT_PENDING], 
                                    sampling=1.0)   # sampling time in seconds

Is that what you mean?

@andre-merzky andre-merzky modified the milestones: v0.47, 0.46 Aug 24, 2017
@andre-merzky andre-merzky removed their assignment Apr 3, 2019
@mturilli mturilli removed the bug label Jun 5, 2019
@mturilli mturilli removed this from the v0.47 milestone Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants