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

tt3 to ttd conversion #41

Merged
merged 75 commits into from
Nov 11, 2019
Merged

tt3 to ttd conversion #41

merged 75 commits into from
Nov 11, 2019

Conversation

mm326
Copy link

@mm326 mm326 commented Nov 11, 2019

No description provided.

PyvesB and others added 30 commits July 17, 2019 09:24
* Don't call fixtures directly

Calling fixtures directly is deprecated, this solution described at
https://docs.pytest.org/en/latest/deprecations.html#calling-fixtures-directly
seems to work, creating a named fixture rather than defining the "then"
step as a fixture directly.

* Mark the two failing tests as xfail until we know how to fix them

This was better than skipping them because some of the other tests depend on the failing ones at least being run. Marking the failing tests as skip just makes those other tests fail.

* Mark the other failing Twisted tests as xfail
Ensures referenced styles are merged into the parent with correct order of preference.

Ensure padding is not specified in style elements
One is failing because the percentages aren't being truncated to 2 decimal points. The other is failing because the converter isn't even attempting to convert the units.
Addresses my review comment.

Makes sure that `c` and `%` lineHeight values are converted correctly, as well as the `normal` value. Rounds to max 2 decimal places and trims trailing zeros before the %, and trailing `.0` if that exists.
These test template files were invalid because they allowed for pixel values to be inserted but didn't specify a root extent. Fixing that here.
…nt is present

Add in padding (which can take pixels) to style and region element validation.
Checks that an ExtentMissingError is thrown if any style attribute that can take pixel values is used and includes them and if no root extent is specified.

Add padding to region test, and add style tests for fontSize, lineHeight and padding.
PhoebeWheelerCode and others added 22 commits October 7, 2019 10:35
… of milliseconds regardless of number of digits

Previously, `00:00:00.17` was converted to a timedelta with _17_ milliseconds instead of 170, and resulted in a different value from `00:00:00.170`, but the spec says stuff after the decimal point is a decimal fraction not a number of milliseconds.

This commit truncates any digits in the fraction beyond the third, without rounding.
Catch regressions to any timedelta conversions from timing types
Removing unnecessary print lines
Adding comments to explain complex functions
Using timedelta to make certain functions unnecessary so they can be removed
Replacing strings in some tests with FullClockTimingType to better represent actual input that would be received
Rename TestNester to TestDenester
Modifying tests to work with the DenesterNode
Removing some facet-based code in tests that was missed when facets were removed
…unt for this

Removed creation of DenesterNode inside converters.py
Modified tests to account for changes in Denester indentation
Added an rst file for the Denester node
This could do with a standard config file and an `ebu-run` command line to run it to demonstrate it in action.
@mm326 mm326 merged commit ae21cbd into master Nov 11, 2019
mm326 added a commit that referenced this pull request Nov 18, 2019
MSPA-728 ebu-tt-3 to ebu-tt-d conversion
nigelmegitt pushed a commit that referenced this pull request Nov 20, 2019
MSPA-728 ebu-tt-3 to ebu-tt-d conversion
nigelmegitt added a commit that referenced this pull request Nov 26, 2019
* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* MSPA-702: Check existence of Styling and Layout elements for EBU-TT-1

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* MSPA-702: body/dur attribute is not allowed in EBU-TT-1

* MSPA-702: Check that smpte timeBase is acceptable in EBU-TT-1

* tt3 to ttd conversion (#41)

MSPA-728 ebu-tt-3 to ebu-tt-d conversion

* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* rebased and fixed ebuttd test files

* extracting ebutt1object base into generic ebuttdocumentbase class

* Add EBU-TT 1 to EBU-TT 3 conversion

Does not handle time conversion.
Sets `ebuttp:sequenceIdentifier` to the value of `tt/head/metadata/documentMetadata/documentIdentifier` if present, otherwise uses "TestConverter".
Resets the `conformsToStandard` to say it is EBU-TT-3 conformant.
Sets the `timeBase` to `media` whether you like it or not, but doesn't do any other conversions.

* Tidy out debug prints and unneeded commented code

* Address review comments

Also allows for a setting that specifies whether or not to use `ebuttm:documentIdentifier` element value in the input as the `ebuttp:sequenceIdentifier` attribute value in the output. Adds a test for this.

* Fix some documentation

Address some warnings and add a page for EBU-TT 1 to EBU-TT 3 conversion. WIP.

* Rename conversion docs

Should have been committed with previous commit.

* Unit test EBUTT1 to EBUTT3 conversion

* Fix validation error messages for unexpected attributes so it doesn't say they are missing.
* Fix cloning of unknown element, and conversion of metadata
* Make EBUTT1Document instantiatable by including required attributes and elements in the constructor
* Add unit test cases for programmatical construction with smpte (skipped) and media timebase
* Add unit test cases for from-document construction with smpte (skipped) and media timebase

* Address review comments

Pass pep8 wherever we can.

* Remove no-longer-used error string

* Rename test file

Helps distinguish test EBU-TT 1 files from test EBU-TT 3 files.

* Address review comment
nigelmegitt pushed a commit that referenced this pull request Nov 26, 2019
MSPA-728 ebu-tt-3 to ebu-tt-d conversion
nigelmegitt added a commit that referenced this pull request Dec 2, 2019
* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* MSPA-702: Check existence of Styling and Layout elements for EBU-TT-1

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* MSPA-702: body/dur attribute is not allowed in EBU-TT-1

* MSPA-702: Check that smpte timeBase is acceptable in EBU-TT-1

* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* tt3 to ttd conversion (#41)

MSPA-728 ebu-tt-3 to ebu-tt-d conversion

* rebased and fixed ebuttd test files

* extracting ebutt1object base into generic ebuttdocumentbase class

* Add EBU-TT 1 to EBU-TT 3 conversion

Does not handle time conversion.
Sets `ebuttp:sequenceIdentifier` to the value of `tt/head/metadata/documentMetadata/documentIdentifier` if present, otherwise uses "TestConverter".
Resets the `conformsToStandard` to say it is EBU-TT-3 conformant.
Sets the `timeBase` to `media` whether you like it or not, but doesn't do any other conversions.

* Address review comments

Also allows for a setting that specifies whether or not to use `ebuttm:documentIdentifier` element value in the input as the `ebuttp:sequenceIdentifier` attribute value in the output. Adds a test for this.

* Unit test EBUTT1 to EBUTT3 conversion

* Fix validation error messages for unexpected attributes so it doesn't say they are missing.
* Fix cloning of unknown element, and conversion of metadata
* Make EBUTT1Document instantiatable by including required attributes and elements in the constructor
* Add unit test cases for programmatical construction with smpte (skipped) and media timebase
* Add unit test cases for from-document construction with smpte (skipped) and media timebase

* Timedelta converter

Creates a fixed offset SMPTE timecode converter that can return a timedelta equivalent for any valid SMPTE timecode value equal to or after the provided reference start point. Invalid timecodes throw errors. The timedelta returned is the difference between the input timecode and the reference timecode.

* Reimplement ebu#516

See ebu#516 for further details.

Enables an `ebuttm:documentStartOfProgramme` element to be included in a document without causing a crash.

* Make a smpte timecode converter

Make a FixedOffsetSMPTEtoTimedeltaConverter to convert SMPTE times based on the `ebuttm:documentStartOfProgramme` element if present, or assuming `00:00:00:00` otherwise.

* pep8 tidying, where possible

* test smpte time conversion

* Unskip tests that now pass because they're implemented
* add a test to check that using the `ebuttm:documentStartOfProgramme` as the basis for time conversion works.
* pep8 tidying

* Discard elements that end up with negative times

Unit test for this also added.
Tidy out some print statements that had made their way in there.

* Add some documentation

The docs in current state don't build properly because  autodoc throws a "cannot import name `EBUTT1EBUTT3Converter`" exception. This is possibly a problem with  circular `import` references, which should be resolved before we merge. This can be demonstrated by adding `from . import ebutt1_ebutt3` to `ebu_tt_live/bindings/converters/__init__.py` and running `python -m ebu_tt_live.bindings.converters` which shows a stack trace illustrating the issue.

* Resolve circular import loop

This was preventing documentation from building correctly.

* Prune empty output elements

* Add documentation and fix node code

* Add EBUTT1 to EBUTT3 producer node config parameters

* Add example config file for EBUTT1 to EBUTT3 conversion

Also a manifest file for its input, using existing test XML file.

* Add documentation

* Correctly format code blocks

RST uses double backticks, not like markdown's single ones!

* Allow start of programme timecode to be manually overridden

Sometimes we might know better than the document what start of programe timecode to use, so allow any value specified in the EBU-TT 1 document to be overridden.

* Address @danielthepope's excellent  review comments

* Tidy .gitignore
* Fix up documentation - backticks, mainly
* Fix/improve code comments
* Use snake case for method name instead of camelCase, to match PEP8
* Test that negative times raise errors
* Fix dropped frame algorithm typo - it really should check frame values! Update tests to be more rigorous in checking that too, since they shouldn't have passed before.
nigelmegitt pushed a commit that referenced this pull request Dec 2, 2019
MSPA-728 ebu-tt-3 to ebu-tt-d conversion
nigelmegitt added a commit that referenced this pull request Dec 4, 2019
* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* Validate bindings for EBU-TT-1 documents by dynamically setting superseding class on document creation

* MSPA-702: Check existence of Styling and Layout elements for EBU-TT-1

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* MSPA-702: EBU-TT-1 document must contain a tt:region element

* MSPA-702: body/dur attribute is not allowed in EBU-TT-1

* MSPA-702: Check that smpte timeBase is acceptable in EBU-TT-1

* tt3 to ttd conversion (#41)

MSPA-728 ebu-tt-3 to ebu-tt-d conversion

* rebased and fixed ebuttd test files

* extracting ebutt1object base into generic ebuttdocumentbase class

* Add EBU-TT 1 to EBU-TT 3 conversion

Does not handle time conversion.
Sets `ebuttp:sequenceIdentifier` to the value of `tt/head/metadata/documentMetadata/documentIdentifier` if present, otherwise uses "TestConverter".
Resets the `conformsToStandard` to say it is EBU-TT-3 conformant.
Sets the `timeBase` to `media` whether you like it or not, but doesn't do any other conversions.

* Address review comments

Also allows for a setting that specifies whether or not to use `ebuttm:documentIdentifier` element value in the input as the `ebuttp:sequenceIdentifier` attribute value in the output. Adds a test for this.

* Discard elements that end up with negative times

Unit test for this also added.
Tidy out some print statements that had made their way in there.

* Add some documentation

The docs in current state don't build properly because  autodoc throws a "cannot import name `EBUTT1EBUTT3Converter`" exception. This is possibly a problem with  circular `import` references, which should be resolved before we merge. This can be demonstrated by adding `from . import ebutt1_ebutt3` to `ebu_tt_live/bindings/converters/__init__.py` and running `python -m ebu_tt_live.bindings.converters` which shows a stack trace illustrating the issue.

* WIP

* Add real world examples to the remove list.

* Removes unwanted elements.

* Tidy and add/fix documentation

* Add element remover unit tests

* Fix default argument

* Check removed elements are present before removal

* Minor non-functional tidying

* Tidy up node processing

* Don't process duplicate documents
* Don't process documents from more than one sequence
* Factor out element removal from sequence processing so we can have a returning method that can be called independently of `process_document` in case the node's functionality is needed without providing a concrete carriage mechanism.

* Write a documentOriginatingSystem element

* Move project-wide data to a single file so we can import it
* Import it into the doc generation `conf.py` and the `setup.py` - great, updating the version now only needs one line of code to change!

* Add input file assertion failure messages

Addresses review comments.

* pep8 tick

* Allow long lines in special cases

And quieten flake8 down

* Don't offer public `remove` method

Addresses review comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants