diff --git a/defaults/docs-defaults.yaml b/defaults/docs-defaults.yaml index 0764762..1b0aa76 100644 --- a/defaults/docs-defaults.yaml +++ b/defaults/docs-defaults.yaml @@ -15,7 +15,7 @@ defaults: audio: 1500 ctv-bvod: 2580 social: 240 - streaming-video: 2580 + streaming-video: 300 web: 320 default_baseload_watts: fixed: 9.550000000 @@ -111,7 +111,7 @@ defaults: sri: fixed: 0.000004430 mobile: 0.000007970 - default_non_primary_video_bitrate_kbps: 2500 + default_non_primary_video_bitrate_kbps: 1200 default_percent_mobile: scope3: 23.600000000 sri: 10.000000000 @@ -263,12 +263,12 @@ defaults: audio: 4.800000000 ctv-bvod: 8.256000000 social: 24 - streaming-video: 8.256000000 + streaming-video: 1 web: 32 default_property_g_per_imp_by_channel: app: 0.049000000 audio: 0.049000000 - ctv-bvod: 0.049000000 + ctv-bvod: 0.280000000 dooh: 0.049000000 social: 0.150000000 streaming-video: 0.049000000 @@ -282,10 +282,10 @@ defaults: fixed: 0.068700000 mobile: 0.236000000 default_video_bitrate_kbps: - pc: 8000 - phone: 2500 - tablet: 5000 - tv: 8000 + pc: 1200 + phone: 800 + tablet: 1000 + tv: 3690 default_video_player_download_trigger: app: impression ctv-bvod: impression diff --git a/docs/calculations.mdx b/docs/calculations.mdx index 55ae43a..91fd5e3 100644 --- a/docs/calculations.mdx +++ b/docs/calculations.mdx @@ -98,17 +98,18 @@ Native product carousel ### Property -| Field | Required | Description | -| ----------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------- | -| `channels` | Yes | The channel(s) of this property | -| `average_seconds_per_session_excluding_ads` | Yes | The average length of a session on this property excluding ads (eg 44 min of a 60 min TV show) | -| `average_imps_per_session` | Yes | The average number of impressions per session | -| `average_data_kb_per_session_excluding_ads` | Yes | The average number of KB transferred during a session excluding ads | -| `ad_funded_percentage` | Yes | 0-100 The percentage of content funded by advertising (eg 50) | -| `allocated_adjusted_corporate_emissions_kgco2e` | Yes | This property's share of corporate emissions | -| `total_sessions` | Yes | Number of sessions in the same time period as corporate emissions | -| `organization_model_quality` | Yes | Parent organization model quality (1-5) | -| `model_quality` | Yes | Model quality (1-5) | +| Field | Description | +| ----------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `channels` | The channel(s) of this property | +| `average_seconds_per_session_excluding_ads` | The average length of a session on this property excluding ads (eg 44 min of a 60 min TV show) | +| `average_imps_per_session` | The average number of impressions per session | +| `average_data_kb_per_session_excluding_ads` | The average number of KB transferred during a session excluding ads | +| `video_bitrate_kbps` | The average bitrate for a CTV-BVOD property (e.g. 4200 kbps) | +| `ad_funded_percentage` | 0-100 The percentage of content funded by advertising (eg 50) | +| `allocated_adjusted_corporate_emissions_kgco2e` | This property's share of corporate emissions | +| `total_sessions` | Number of sessions in the same time period as corporate emissions | +| `organization_model_quality` | Parent organization model quality (1-5) | +| `model_quality` | Model quality (1-5) | ### Ad Platform @@ -360,6 +361,7 @@ default_bitrate_kbps = video_bitrate_kbps = creative_video_bitrate_kbps ?? creative_video_size_bytes x 8 / 1000 / creative_video_duration ?? + property.video_bitrate_kbps[device_type] ?? default_bitrate_kbps video_duration = creative_video_duration_seconds ?? ad_format.video_duration_seconds seconds_watched = creative_video_view_time_seconds ?? @@ -484,7 +486,7 @@ media_data_transfer_embodied_emissions_gco2_per_imp = For CTV/BVOD, use the power model: ``` -video_bitrate_kbps = default_video_bitrate_kbps[device_type] +video_bitrate_kbps = property.video_bitrate_kbps[device_type] ?? default_video_bitrate_kbps[device_type] power_watts = baseload_watts + diff --git a/docs/snippets/defaults_channel_mapping.mdx b/docs/snippets/defaults_channel_mapping.mdx index cada85d..e582ac2 100644 --- a/docs/snippets/defaults_channel_mapping.mdx +++ b/docs/snippets/defaults_channel_mapping.mdx @@ -50,7 +50,7 @@ default_platform_ad_format_by_channel: default_property_average_imps_per_session_by_channel: social: 24 ctv-bvod: 8.256 - streaming-video: 8.256 + streaming-video: 1 audio: 4.8 app: 14 web: 32 @@ -65,7 +65,7 @@ default_property_ad_funded_percentage_by_channel: default_average_seconds_per_session_excluding_ads_by_channel: social: 240 ctv-bvod: 2580 - streaming-video: 2580 + streaming-video: 300 audio: 1500 app: 140 web: 320 @@ -77,7 +77,7 @@ default_property_g_per_imp_by_channel: dooh: 0.049 social: 0.15 streaming-video: 0.049 - ctv-bvod: 0.049 + ctv-bvod: 0.280 audio: 0.049 app: 0.049 web: 0.049 diff --git a/docs/snippets/defaults_media_size.mdx b/docs/snippets/defaults_media_size.mdx index 298dc32..f82a0c5 100644 --- a/docs/snippets/defaults_media_size.mdx +++ b/docs/snippets/defaults_media_size.mdx @@ -1,11 +1,11 @@ ``` default_image_compression_ratio: 10 -default_non_primary_video_bitrate_kbps: 2500 +default_non_primary_video_bitrate_kbps: 1200 default_video_bitrate_kbps: - phone: 2500 - tablet: 5000 - pc: 8000 - tv: 8000 + phone: 800 + tablet: 1000 + pc: 1200 + tv: 3690 default_audio_bitrate_kbps: phone: 160 tablet: 160 diff --git a/poetry.lock b/poetry.lock index 1600178..3767dee 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,9 +1,10 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.4.0 and should not be changed by hand. [[package]] name = "annotated-types" version = "0.6.0" description = "Reusable constraint types to use with typing.Annotated" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -15,6 +16,7 @@ files = [ name = "anyio" version = "4.3.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -37,6 +39,7 @@ trio = ["trio (>=0.23)"] name = "astroid" version = "3.1.0" description = "An abstract syntax tree for Python with inference support." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -51,6 +54,7 @@ typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} name = "attrs" version = "23.2.0" description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -70,6 +74,7 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p name = "black" version = "24.3.0" description = "The uncompromising code formatter." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -116,6 +121,7 @@ uvloop = ["uvloop (>=0.15.2)"] name = "certifi" version = "2024.7.4" description = "Python package for providing Mozilla's CA Bundle." +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -127,6 +133,7 @@ files = [ name = "cfgv" version = "3.4.0" description = "Validate configuration and produce human readable error messages." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -138,6 +145,7 @@ files = [ name = "charset-normalizer" version = "3.3.2" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "dev" optional = false python-versions = ">=3.7.0" files = [ @@ -237,6 +245,7 @@ files = [ name = "click" version = "8.1.7" description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -251,6 +260,7 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} name = "click-log" version = "0.4.0" description = "Logging integration for Click" +category = "dev" optional = false python-versions = "*" files = [ @@ -265,6 +275,7 @@ click = "*" name = "colorama" version = "0.4.6" description = "Cross-platform colored terminal text." +category = "main" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" files = [ @@ -276,6 +287,7 @@ files = [ name = "coverage" version = "7.4.3" description = "Code coverage measurement for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -340,6 +352,7 @@ toml = ["tomli"] name = "dill" version = "0.3.8" description = "serialize all of Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -355,6 +368,7 @@ profile = ["gprof2dot (>=2022.7.29)"] name = "distlib" version = "0.3.8" description = "Distribution utilities" +category = "dev" optional = false python-versions = "*" files = [ @@ -366,6 +380,7 @@ files = [ name = "exceptiongroup" version = "1.2.0" description = "Backport of PEP 654 (exception groups)" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -380,6 +395,7 @@ test = ["pytest (>=6)"] name = "fastapi" version = "0.110.0" description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -399,6 +415,7 @@ all = ["email-validator (>=2.0.0)", "httpx (>=0.23.0)", "itsdangerous (>=1.1.0)" name = "filelock" version = "3.13.1" description = "A platform independent file lock." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -415,6 +432,7 @@ typing = ["typing-extensions (>=4.8)"] name = "flake8" version = "7.0.0" description = "the modular source code checker: pep8 pyflakes and co" +category = "dev" optional = false python-versions = ">=3.8.1" files = [ @@ -431,6 +449,7 @@ pyflakes = ">=3.2.0,<3.3.0" name = "h11" version = "0.14.0" description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -442,6 +461,7 @@ files = [ name = "identify" version = "2.5.35" description = "File identification library for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -456,6 +476,7 @@ license = ["ukkonen"] name = "idna" version = "3.6" description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=3.5" files = [ @@ -467,6 +488,7 @@ files = [ name = "iniconfig" version = "2.0.0" description = "brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -478,6 +500,7 @@ files = [ name = "isort" version = "5.13.2" description = "A Python utility / library to sort Python imports." +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -492,6 +515,7 @@ colors = ["colorama (>=0.4.6)"] name = "jinja2" version = "3.1.3" description = "A very fast and expressive template engine." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -509,6 +533,7 @@ i18n = ["Babel (>=2.7)"] name = "markdown-it-py" version = "3.0.0" description = "Python port of markdown-it. Markdown parsing, done right!" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -533,6 +558,7 @@ testing = ["coverage", "pytest", "pytest-cov", "pytest-regressions"] name = "markupsafe" version = "2.1.5" description = "Safely add untrusted strings to HTML/XML markup." +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -602,6 +628,7 @@ files = [ name = "mccabe" version = "0.7.0" description = "McCabe checker, plugin for flake8" +category = "dev" optional = false python-versions = ">=3.6" files = [ @@ -613,6 +640,7 @@ files = [ name = "mdurl" version = "0.1.2" description = "Markdown URL utilities" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -624,6 +652,7 @@ files = [ name = "mypy" version = "1.8.0" description = "Optional static typing for Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -671,6 +700,7 @@ reports = ["lxml"] name = "mypy-extensions" version = "1.0.0" description = "Type system extensions for programs checked with the mypy type checker." +category = "dev" optional = false python-versions = ">=3.5" files = [ @@ -682,6 +712,7 @@ files = [ name = "nodeenv" version = "1.8.0" description = "Node.js virtual environment builder" +category = "dev" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ @@ -696,6 +727,7 @@ setuptools = "*" name = "packaging" version = "23.2" description = "Core utilities for Python packages" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -707,6 +739,7 @@ files = [ name = "pathspec" version = "0.12.1" description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -718,6 +751,7 @@ files = [ name = "platformdirs" version = "4.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -733,6 +767,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest- name = "pluggy" version = "1.4.0" description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -748,6 +783,7 @@ testing = ["pytest", "pytest-benchmark"] name = "pre-commit" version = "3.6.2" description = "A framework for managing and maintaining multi-language pre-commit hooks." +category = "dev" optional = false python-versions = ">=3.9" files = [ @@ -766,6 +802,7 @@ virtualenv = ">=20.10.0" name = "pycodestyle" version = "2.11.1" description = "Python style guide checker" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -777,6 +814,7 @@ files = [ name = "pydantic" version = "2.6.2" description = "Data validation using Python type hints" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -796,6 +834,7 @@ email = ["email-validator (>=2.0.0)"] name = "pydantic-core" version = "2.16.3" description = "" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -887,6 +926,7 @@ typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" name = "pyflakes" version = "3.2.0" description = "passive checker of Python programs" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -898,6 +938,7 @@ files = [ name = "pylint" version = "3.1.0" description = "python code static checker" +category = "dev" optional = false python-versions = ">=3.8.0" files = [ @@ -910,8 +951,8 @@ astroid = ">=3.1.0,<=3.2.0-dev0" colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} dill = [ {version = ">=0.2", markers = "python_version < \"3.11\""}, + {version = ">=0.3.6", markers = "python_version >= \"3.11\""}, {version = ">=0.3.7", markers = "python_version >= \"3.12\""}, - {version = ">=0.3.6", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, ] isort = ">=4.2.5,<5.13.0 || >5.13.0,<6" mccabe = ">=0.6,<0.8" @@ -927,6 +968,7 @@ testutils = ["gitpython (>3)"] name = "pytest" version = "8.0.2" description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -949,6 +991,7 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no name = "pyyaml" version = "6.0.1" description = "YAML parser and emitter for Python" +category = "main" optional = false python-versions = ">=3.6" files = [ @@ -1009,6 +1052,7 @@ files = [ name = "requests" version = "2.32.2" description = "Python HTTP for Humans." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1030,6 +1074,7 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] name = "scriv" version = "1.5.1" description = "Scriv changelog management tool" +category = "dev" optional = false python-versions = "*" files = [ @@ -1054,6 +1099,7 @@ yaml = ["pyyaml"] name = "setuptools" version = "70.0.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1069,6 +1115,7 @@ testing = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metad name = "sniffio" version = "1.3.1" description = "Sniff out which async library your code is running under" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1080,6 +1127,7 @@ files = [ name = "starlette" version = "0.36.3" description = "The little ASGI library that shines." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1097,6 +1145,7 @@ full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7 name = "tomli" version = "2.0.1" description = "A lil' TOML parser" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1108,6 +1157,7 @@ files = [ name = "tomlkit" version = "0.12.3" description = "Style preserving TOML library" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1119,6 +1169,7 @@ files = [ name = "types-pyyaml" version = "6.0.12.12" description = "Typing stubs for PyYAML" +category = "dev" optional = false python-versions = "*" files = [ @@ -1130,6 +1181,7 @@ files = [ name = "typing-extensions" version = "4.10.0" description = "Backported and Experimental Type Hints for Python 3.8+" +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1141,6 +1193,7 @@ files = [ name = "urllib3" version = "2.2.2" description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "dev" optional = false python-versions = ">=3.8" files = [ @@ -1158,6 +1211,7 @@ zstd = ["zstandard (>=0.18.0)"] name = "uvicorn" version = "0.27.1" description = "The lightning-fast ASGI server." +category = "main" optional = false python-versions = ">=3.8" files = [ @@ -1177,6 +1231,7 @@ standard = ["colorama (>=0.4)", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", name = "virtualenv" version = "20.25.1" description = "Virtual Python Environment builder" +category = "dev" optional = false python-versions = ">=3.7" files = [ diff --git a/requirements.txt b/requirements.txt index b89e3dc..1a3c4dc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,9 +19,9 @@ fastapi==0.110.0 ; python_version >= "3.10" \ h11==0.14.0 ; python_version >= "3.10" \ --hash=sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d \ --hash=sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761 -idna==3.7 ; python_version >= "3.10" \ - --hash=sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc \ - --hash=sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0 +idna==3.6 ; python_version >= "3.10" \ + --hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \ + --hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f pydantic-core==2.16.3 ; python_version >= "3.10" \ --hash=sha256:00ee1c97b5364b84cb0bd82e9bbf645d5e2871fb8c58059d158412fee2d33d8a \ --hash=sha256:0d32576b1de5a30d9a97f300cc6a3f4694c428d956adbc7e6e2f9cad279e45ed \