Skip to content

Commit

Permalink
Merge pull request #27 from Stoops-ML/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
Stoops-ML authored Dec 23, 2024
2 parents 3cc63e9 + fb7a135 commit df8d331
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 54 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v2.2.2

* Update license
* Update docs
* Add depreciation warning to `CZMLWidget()`

# v2.2.1

* Expand preamble checking in Document()
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BSD-3-Clause license
Copyright (c) 2015-2022, conda-forge contributors
Copyright (c) 2015-2024, czml3 contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
34 changes: 0 additions & 34 deletions MissingProperties.md

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# czml3
![pypi](https://img.shields.io/pypi/v/czml3)
![conda](https://img.shields.io/conda/vn/conda-forge/czml3?label=conda)
[![pypi](https://img.shields.io/pypi/v/czml3)](https://pypi.org/project/czml3/)
[![conda](https://img.shields.io/conda/vn/conda-forge/czml3?label=conda)](https://anaconda.org/conda-forge/czml3)
![Python](https://img.shields.io/pypi/pyversions/czml3)
[![codecov](https://codecov.io/gh/Stoops-ML/czml3/graph/badge.svg?token=EF8SIL2JBV)](https://codecov.io/gh/Stoops-ML/czml3)
![pypi-downloads](https://img.shields.io/pepy/dt/czml3?label=pypi%20downloads)
Expand All @@ -14,7 +14,7 @@ From the official [CZML Guide](https://github.com/AnalyticalGraphicsInc/czml-wri
czml3 aims to make the process of writing CZML files in Python easy by:
- Type checking properties
- Cooercion of data to their required format
- Creating minimal CZML files that only contains fields with information
- Creating minimal CZML files

## Insallation
You can install czml3 using pip:
Expand Down Expand Up @@ -42,7 +42,7 @@ from czml3.properties import (
)
from czml3.types import Cartesian3Value
packet_box = Packet(
id="my_id", # fixing id here to ensure test passes
id="my_id",
position=Position(cartographicDegrees=[-114.0, 40.0, 300000.0]),
box=Box(
dimensions=BoxDimensions(
Expand Down Expand Up @@ -116,6 +116,6 @@ print(Position(cartographicDegrees=np.array([-114, 40, 300000], dtype=int)))
```

## Contributing
You want to contribute? Awesome! There are lots of [CZML properties](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Packet) and validations that we still did not implement, which can be found [here](MissingProperties.md).
You want to contribute? Awesome! There are lots of [CZML properties](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Packet) and validations that we still did not implement, which can be found [here](https://czml3.readthedocs.io/en/latest/user/contributing.html).

All ideas welcome!
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ From the official `CZML Guide <https://github.com/AnalyticalGraphicsInc/czml-wri

| CZML is a JSON format for describing a time-dynamic graphical scene, primarily for display in a web browser running Cesium. It describes lines, points, billboards, models, and other graphical primitives, and specifies how they change with time.
czml3 aims to make the process of writing CZML files in Python easy by:
* Type checking properties
* Cooercion of data to their required format
* Creating minimal CZML files

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/user/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ A CZML document is a list of ``packets``, which have several properties. Recreat
SolidColorMaterial,
)
packet_box = Packet(
id="my_id", # fixing id here to ensure test passes
id="my_id",
position=Position(cartographicDegrees=[-114.0, 40.0, 300000.0]),
box=Box(
dimensions=BoxDimensions(
Expand Down
6 changes: 3 additions & 3 deletions docs/user/features.rst
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Features
========

The goal of czml3 is to make the process of writing CZML files in Python.
The goal of czml3 is to make the process of writing CZML files in Python easy. This page details the features that allow czml3 to achieve this goal.

Type Checking
-------------

czml3 is built upon Pydantic. Therefore, all classes enforces type checking on the inputs. This ensures that the data is in the correct format before it is written to the CZML file.
czml3 is built using Pydantic. Therefore, all classes enforces type checking on the inputs. This ensures that the data is in the correct format before it is written to the CZML file.

Cooercion of Data
-----------------

Again, czml3 is build upon Pydantic. Therefore, czml3 is able to `coerce data to their right type <https://docs.pydantic.dev/latest/why/#json-schema>`_. See Example 2 in :ref:`examples-label`.
Again, czml3 is build using Pydantic. Therefore, czml3 is able to `coerce data to their right type <https://docs.pydantic.dev/latest/why/#json-schema>`_. See Example 2 in :ref:`examples-label`.

Minimal CZML File Creation
--------------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ User Manual

installation
features
examples
examples
contributing
13 changes: 5 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,18 @@ description = "Python 3 library to write CZML"
readme = "README.md"
requires-python = ">=3.10"
keywords = ["czml", "cesium"]
license = {text = "MIT"}
license = {file = "LICENSE.txt"}
classifiers = [
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
]
dependencies = [
Expand All @@ -107,10 +106,8 @@ dev = [
]

[project.urls]
Homepage = "https://github.com/Stoops-ML/czml3"
Repository = "https://github.com/Stoops-ML/czml3"
Issues = "https://github.com/Stoops-ML/czml3/issues"
Changelog = "https://github.com/Stoops-ML/czml3/blob/main/CHANGELOG.md"
Documentation = "https://czml3.readthedocs.io/en"

[tool.setuptools.dynamic]
version = {attr = "czml3.__version__"}
Expand Down
2 changes: 1 addition & 1 deletion src/czml3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .core import CZML_VERSION, Document, Packet

__version__ = "2.2.1"
__version__ = "2.2.2"

__all__ = ["Document", "Packet", "CZML_VERSION"]
6 changes: 6 additions & 0 deletions src/czml3/widget.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from uuid import uuid4

from pydantic import BaseModel, Field
Expand Down Expand Up @@ -75,6 +76,11 @@


class CZMLWidget(BaseModel):
warnings.warn(
"CZMLWidget is deprecated and will be removed in a future version.",
DeprecationWarning,
stacklevel=2,
)
document: Document = Field(
default=Document(
packets=[Packet(id="document", name="name", version=CZML_VERSION)]
Expand Down

0 comments on commit df8d331

Please sign in to comment.