Skip to content

Commit

Permalink
Merge pull request #96 from DenizUgur/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
DenizUgur authored Sep 12, 2023
2 parents 17f0f1a + 4835e29 commit e7010eb
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# Icon must end with two \r
Icon


# Thumbnails
._*

Expand Down Expand Up @@ -361,6 +360,3 @@ pyrightconfig.json
.ionide

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,node,macos


src/mp4ra
12 changes: 3 additions & 9 deletions conformance-search/src/components/CoverageSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,11 @@ export default function CoverageSummary({ className }: { className?: string }) {
<h2 className="text-center text-lg font-light capitalize tracking-tight md:text-xl">
Coverage Statistics
</h2>
<div className="mt-3 grid w-full max-w-4xl grid-cols-2 place-items-center justify-center text-lg md:mt-6">
<div className="mt-3 grid w-full max-w-3xl grid-cols-3 text-lg md:mt-6">
<div className="my-1.5 flex flex-col items-center justify-center md:my-3">
<Number value={coverageStats.files.published_count} />
<span className="text-center text-sm font-extralight uppercase tracking-wide md:text-lg">
Files Submitted
</span>
</div>
<div className="my-1.5 flex flex-col items-center justify-center md:my-3">
<Number value={coverageStats.files.under_consideration_count} />
<span className="text-center text-sm font-extralight uppercase tracking-wide md:text-lg">
Files Under Consideration
Files
</span>
</div>
<div className="my-1.5 flex flex-col items-center justify-center md:my-3">
Expand All @@ -80,8 +74,8 @@ export default function CoverageSummary({ className }: { className?: string }) {
Features
</span>
</div>
<SpecsCovered className="col-span-2 mt-3 md:mt-6" compact={mobile} />
</div>
<SpecsCovered className="mt-3 md:mt-12" compact={mobile} />
</div>
);
}
Expand Down
17 changes: 13 additions & 4 deletions conformance-search/src/components/FileComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ function getDownloadURL(file: FileMetadata, relativeFile?: string) {
function DetailItem({
label,
children,
noTruncate,
className
}: {
label: string;
children: string | React.ReactNode;
noTruncate?: boolean;
className?: string;
}) {
return (
Expand All @@ -41,15 +43,18 @@ function DetailItem({
Not available
</span>
) : (
<span className="table-cell truncate text-sm">{children}</span>
<span className={clsx("table-cell text-sm", !noTruncate && "truncate")}>
{children}
</span>
)}
</span>
</div>
);
}

DetailItem.defaultProps = {
className: ""
className: "",
noTruncate: false
};

function DetailsModal({ file }: { file: FileMetadata }) {
Expand Down Expand Up @@ -108,7 +113,11 @@ function DetailsModal({ file }: { file: FileMetadata }) {
<DetailItem className="col-span-2" label="MD5 Checksum">
<code>{file.md5}</code>
</DetailItem>
<DetailItem className="col-span-2" label="Description">
<DetailItem
className="col-span-2 whitespace-pre-line"
label="Description"
noTruncate
>
{file.description}
</DetailItem>
</div>
Expand Down Expand Up @@ -318,7 +327,7 @@ export default function FileComponent({ file }: { file: FileSearchResult }) {
</>
)}
</p>
<p className="text-justify text-sm text-neutral-800">
<p className="line-clamp-3 whitespace-pre-line text-sm text-neutral-800">
{file.item.description === "" ? (
<span className="text-gray-500">No description available.</span>
) : (
Expand Down
8 changes: 1 addition & 7 deletions conformance-search/src/pages/CoveragePage/CoverageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function StatisticDisplay({
</span>
</div>
<span className="text-xs font-light">
{value} of {adjustedTotal} {alt} {alt.includes("file") ? "published" : "covered"}
{value} of {adjustedTotal} {alt} covered
</span>
{excluded > 0 && (
<span className="text-xs font-light">
Expand Down Expand Up @@ -100,12 +100,6 @@ export default function CoverageHeader({
return (
<div className="flex w-full flex-col gap-4">
<div className="flex flex-wrap items-stretch gap-4">
<StatisticDisplay
alt="files"
label="Conformance Files"
total={processedCoverageStats.files.count}
value={processedCoverageStats.files.published_count}
/>
<StatisticDisplay
alt="features"
excluded={processedCoverageStats.lists.features.under_consideration.length}
Expand Down
4 changes: 2 additions & 2 deletions conformance-search/src/pages/CoveragePage/CoveragePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default function CoveragePage() {
const mobile = useMobile();
const [processedCoverageStats, setProcessedCoverageStats] = useState<Coverage>();
const [search, setSearch] = useState("");
const [depth, setDepth] = useState(3);
const [depth, setDepth] = useState(1);
const [fuses, setFuses] = useState<{
boxes: {
covered: Fuse<string>;
Expand Down Expand Up @@ -223,7 +223,7 @@ export default function CoveragePage() {
<span className="whitespace-nowrap text-xl font-bold">Depth Setting</span>
<Slider
className="mr-1 grow lg:grow-0 lg:basis-1/3"
defaultValue={3}
defaultValue={1}
max={maxDepth}
min={1}
onChange={(_, value) => setDepth(value as number)}
Expand Down
4 changes: 2 additions & 2 deletions data/schemas/gpac-extension.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@Type": {
"type": "string",
"description": "fourcc of the box",
"pattern": "^[0-9a-zA-Z]{4}$"
"pattern": "^[\\u0020-\\u007E]{4}$"
},
"@Version": {
"anyOf": [
Expand Down Expand Up @@ -58,7 +58,7 @@
"properties": {
"location": {
"type": "string",
"pattern": "^file(?>\\.[0-9a-zA-Z]{4})*$",
"pattern": "^file(?>\\.[\\u0020-\\u007E]{4})*$",
"description": "Dot seperated location of the box in relation to the file"
},
"box": { "$ref": "#/$defs/box" }
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
"name": "fileformatconformance",
"version": "1.0.0",
"scripts": {
"test": "npm run build:data && npm run test:data",
"test:data": "cd src && poetry run pytest -- --check-max-tb=0",
"testall": "cd src && poetry run construct-all && poetry run coverage && poetry run pytest -- --check-max-tb=0",
"build:data": "cd src && poetry run construct-all && poetry run coverage",
"watch:data:full": "nodemon --watch data --exec \"npm run build:data && npm run test:data && npm --prefix conformance-search run copy:data\"",
"watch:data": "nodemon --watch data --exec \"npm run build:data && npm --prefix conformance-search run copy:data\"",
"dev:full": "concurrently \"npm run watch:data:full\" \"npm --prefix conformance-search run dev\"",
"dev": "concurrently \"npm run watch:data\" \"npm --prefix conformance-search run dev\""
"dev": "concurrently \"npm run watch:data\" \"npm --prefix conformance-search run dev\"",
"postinstall": "cd src && poetry install"
},
"dependencies": {
"concurrently": "^8.2.1",
Expand Down
6 changes: 6 additions & 0 deletions src/feature_extractor/file_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,12 @@ def extract_file_features():
print("ERROR: You can only provide either --input or --dir-input")
sys.exit(-1)

# Exclude file if extension is in EXCLUDELIST
_, input_extension = os.path.splitext(args.input)
if input_extension in EXCLUDELIST:
print(f"Skip {args.input}")
sys.exit(0)

if args.input is not None:
_extract_file_features(args)

Expand Down
8 changes: 5 additions & 3 deletions src/tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,11 @@ def test_folder_consistency(check):
print(f"Unaccounted file: {file}")

# Check if there are any files left
assert (
ALL_FILES == FOUND_FILES
), f"Found {len(ALL_FILES) - len(FOUND_FILES)} unaccounted files."
with check:
consistent_files = ALL_FILES == FOUND_FILES
assert (
consistent_files
), f"Found {len(ALL_FILES) - len(FOUND_FILES)} unaccounted files."


@pytest.mark.dependency(depends=["test_folder_consistency"])
Expand Down

0 comments on commit e7010eb

Please sign in to comment.