https://github.com/tensorly/tensorly
Revision a1e4e2ad71389209120b05303b769f6b8db18696 authored by Jean Kossaifi on 22 June 2020, 13:59:02 UTC, committed by GitHub on 22 June 2020, 13:59:02 UTC
Fixing modes in parafac and nonegative_parafac
2 parent s 16eb359 + e452f3e
Raw File
Tip revision: a1e4e2ad71389209120b05303b769f6b8db18696 authored by Jean Kossaifi on 22 June 2020, 13:59:02 UTC
Merge pull request #171 from cohenjer/feature_fixed-mode
Tip revision: a1e4e2a
minify.py
from slimit import minify
from rcssmin import cssmin

from pathlib import Path
asset_path = Path('./themes/tensorly/static')

for path in asset_path.glob('*.js'):
    # Ignore already minified files
    if '.min.' in str(path):
        continue
    target_path = path.with_suffix('.min.js')
    with open(path.as_posix(), 'r') as f:
        text = f.read()
    minified = minify(text, mangle=True, mangle_toplevel=True)
    with open(target_path.as_posix(), 'w') as f:
        f.write(minified)

for path in asset_path.glob('*.css'):
    # Ignore already minified files
    if '.min.' in str(path):
        continue
    target_path = path.with_suffix('.min.css')
    with open(path.as_posix(), 'r') as f:
        text = f.read()
    minified = cssmin(text)
    with open(target_path.as_posix(), 'w') as f:
        f.write(minified)

back to top