Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Sequence type is improperly defined #162

Open
Stoops-ML opened this issue Dec 2, 2024 · 5 comments
Open

Sequence type is improperly defined #162

Stoops-ML opened this issue Dec 2, 2024 · 5 comments

Comments

@Stoops-ML
Copy link
Collaborator

Stoops-ML commented Dec 2, 2024

The Sequence type (link) is too broadly defined as it accepts as input list[Any]. It isn't defined in the CZML wiki, and the only use case I can see for it is for defining a list of TimeIntervals (e.g. here) or a list of IntervalValues (e.g. here).

It seems more appropriate to replace the Sequence class with either:

  1. SequenceTime (or something similar) class that accepts list[TimeInterval] | list[IntervalValue]
  2. SequenceTimeInterval class and SequenceIntervalValue class

My preference is for option 1.

As a side note I think many people will get this class confused with the Sequence class from collections.abc.

@astrojuanlu let me know your thoughts and I'll submit a PR (along with some other bug fixes I've found recently).

@Stoops-ML
Copy link
Collaborator Author

@astrojuanlu bump

@astrojuanlu
Copy link
Member

I agree, Sequence is too broad. Weird that it's not defined in the CZML wiki, wondering where did I take it from then.

I would find it weird that SequenceTime accepts list[InternalValue] too, can't we make Sequence accept list[TimeInterval] | list[IntervalValue], find some other generic enough name, or otherwise define two classes?

@Stoops-ML
Copy link
Collaborator Author

From the TimeIntervalCollection wiki:

A collection of time intervals, specified in ISO8601 interval format.

I think TimeIntervalCollection that accepts list[TimeInterval] | list[IntervalValue] would be appropriate. IntervalValue is simply a wrapper of TimeInterval, so the name TimeIntervalCollection covers all bases.

Note that I can't find anything related to czml3's IntervalValue class in the wiki.

@Stoops-ML
Copy link
Collaborator Author

I also want to add that changing the class name from Sequence is important as the name also exists in the very widely used collections.abc library.

@astrojuanlu
Copy link
Member

Good points. Then let's go ahead with your option 👍🏼

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants