Giter Site home page Giter Site logo

eg--lsseq's People

Contributors

uncojohnco avatar

Stargazers

 avatar

Watchers

 avatar  avatar

eg--lsseq's Issues

Add - Functional tests for vanilla pip install and with --editable

from pathlib import Path
import site
import runpy

# TODO: Have this behavior work  with both - vanilla "pip install" and with --editable

# Works with "pip install --editable ."
# root = Path(__file__).parent.parent
# filepath = str(root.joinpath('src/lss/lss_cli.py'))

# Works with "pip install ."
root = Path(site.getsitepackages()[0])  # TODO: This should be more robust...
filepath = str(root.joinpath('lss/lss_cli.py'))

implement github workflow to run on multiple platforms

https://github.com/ymyzk/tox-gh-actions
https://hynek.me/articles/python-github-actions/

tests-doctest-module.yml - WIP

name: Doctest

on:
  push:
    paths:
      - 'src/lss/**'

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        platform: [ubuntu-latest, macos-latest, windows-latest]
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install tox tox-gh-actions
    - name: Run Doctests (temp - ignore )
      run: |
        pytest src/lss --doctest-modules --ignore=notebooks  --ignore=src/lss/lsseq.py
      env:
        PLATFORM: ${{ matrix.platform }}

Deprecate: `Item` object

Item object was originally implemented to resolve the characters representing the frame in a str via doing a comparisons str_parts and str_digits.

This behaviour has been superseded and exists in lss.util::find_matching_frame_substrings

class Item:
"""
A primitive class for defining an abstract representation of an item.
The purpose to be used to find the substring representing
a frame against another item.
Examples:
>>> item = Item('mario01_v003.rgb')
>>> item.name
'mario01_v003.rgb'
>>> item.str_parts
['mario', '_v', '.rgb']
>>> item.str_digits
['01', '003']
"""

def find_matching_frame_substrings(
str1: str, str2: str,
strict=True) -> Optional[SubstrMatch]:
"""
Diff between str1 and str2 to to resolve the frame representation
of each string.
Examples:
>>> find_matching_frame_substrings('file01_0040.rgb', 'file01_0041.rgb')
SubstrMatch(pos=SubstrPos(start=7, end=11), groups=('0040', '0041'))
>>> find_matching_frame_substrings('file1.03.rgb', 'file2.03.rgb')
SubstrMatch(pos=SubstrPos(start=4, end=5), groups=('1', '2'))
>>> bool(find_matching_frame_substrings('file02_0040.rgb', 'file01_0041.rgb'))
False
:param str1: The string object for comparison against.
:param str2: The string to compare to the object string.
:param strict: If True, the length of the digit padding
must be the same when comparing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.