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

do not render hz if no messages #1006

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

james-rms
Copy link
Collaborator

@james-rms james-rms commented Nov 1, 2023

Public-Facing Changes

For mcap info, removes channel hz display if there are no or one messages in a channel. This avoids displaying an ugly NaN or Inf.

Before:

j@192-168-1-108 python % mcap info ~/this.mcap                                
library:   python mcap 1.1.1                                        
profile:                                                            
messages:  1                                                        
duration:  0s                                                       
start:     2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
end:       2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
compression:
        zstd: [1/1 chunks] [234.00 B/153.00 B (34.62%)] 
channels:
        (1) sample_topic  0 msgs (NaN Hz)    : sample [jsonschema]  
        (2) sample_topic  1 msgs (+Inf Hz)   : sample [jsonschema]  
attachments: 0
metadata: 0

After:

j@192-168-1-108 mcap % ./bin/mcap info ~/this.mcap                          
library:   python mcap 1.1.1                                        
profile:                                                            
messages:  1                                                        
duration:  0s                                                       
start:     2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
end:       2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
compression:
        zstd: [1/1 chunks] [234.00 B/153.00 B (34.62%)] 
channels:
        (1) sample_topic  0 msgs   : sample [jsonschema]  
        (2) sample_topic  1 msgs   : sample [jsonschema]  
attachments: 0
metadata: 0

@james-rms james-rms merged commit 4ab424e into main Nov 1, 2023
25 checks passed
@james-rms james-rms deleted the james/fg-5522-cli-0-msgs-nan-hz-foxglovemcap-1004 branch November 1, 2023 23:32
pezy pushed a commit to pezy/mcap that referenced this pull request Jan 11, 2024
### Public-Facing Changes

For `mcap info`, removes channel hz display if there are no or one
messages in a channel. This avoids displaying an ugly `NaN` or `Inf`.

Before:
```
j@192-168-1-108 python % mcap info ~/this.mcap                                
library:   python mcap 1.1.1                                        
profile:                                                            
messages:  1                                                        
duration:  0s                                                       
start:     2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
end:       2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
compression:
        zstd: [1/1 chunks] [234.00 B/153.00 B (34.62%)] 
channels:
        (1) sample_topic  0 msgs (NaN Hz)    : sample [jsonschema]  
        (2) sample_topic  1 msgs (+Inf Hz)   : sample [jsonschema]  
attachments: 0
metadata: 0
```

After:
```
j@192-168-1-108 mcap % ./bin/mcap info ~/this.mcap                          
library:   python mcap 1.1.1                                        
profile:                                                            
messages:  1                                                        
duration:  0s                                                       
start:     2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
end:       2023-11-02T05:34:10.165983+11:00 (1698863650.165983000)  
compression:
        zstd: [1/1 chunks] [234.00 B/153.00 B (34.62%)] 
channels:
        (1) sample_topic  0 msgs   : sample [jsonschema]  
        (2) sample_topic  1 msgs   : sample [jsonschema]  
attachments: 0
metadata: 0
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants