Skip to content

Commit

Permalink
Changelog: Final
Browse files Browse the repository at this point in the history
2023-06-03 v01.00.001-Beta
=== CHANGELOG ===
### Status
    - UAT Accepted
### Noted (ADR|etc)#
    - Final
### Bumped
### Added
### Mutated/Updated
    - Fixes
### Removed
    - Removal of Unused code:

=== PROJECTLOG ===
### Tested
    - Bugs
      - ☑️Record all bugs in README -> GitHub Issues
        - ☑️What was the problem?
        - ☑️What was the solution?
        - ☑️If you could not resolve it, include it in README
        - Include screenshots of bugs in README
    - Validation
      - ☑️Code Validation
      - ☑️Formatting
      - ☑️Linting
    - Error Handling
      - ☑️User cannot submit empty input
      - ☑️Error messages are informative
      - Check for out of bounds error > 0, <70
    - ☑️User Story
      - ☑️Story: As a User I want to ...
      - ☑️Story Testing: Feature and details that answer story
      - ☑️Format: Tabular view, two columns
    - ☑️Features (Feature acceptance testing)
      - ☑️Feature:
      - ☑️Test:
      - ☑️Outcome/Effect:
    - ☑️Testing Plan is
      - ☑️To test commands for issues and get results back ☑️
        - `find locate` and prompt works ☑️️
      - ☑️To check the option parameters for function, and valid/invalid input
      - ☑️To check for user flow if they make the wrong error
      - ☑️The query data should be much smaller dataset for user to work on ☑️️
         -☑️ `find locate` and retrieve a single record ☑️️
         - ☑️creates a class Record ☑️️
      - ☑️To then sore/cache the result query data for CrUD ops
        - ☑️Create an editor, that manipulates the record series / frame ☑️️
        - ☑️Read the smaller working data ☑️️
        - ☑️Create a new item to working data or source data ☑️ or
        - ☑️Update same item, ☑️ or
        - ☑️Delete the same item ☑️ or
       - ☑️To present and results ⏸☑️  - Side by side for individual records
       - ☑️Change the web view for wider coverage
       - To commit changes to the remote datastore ⏸️ or
       - To repeat on the new data - each command request data each time. ⏸️
### Commenting: LO 1.3.1
    CRITICAL
    - ☑️ app.py: Module, Classes, Methods and by Docstrings
    - ☑️ controller.py: Module, Classes, Methods and by Docstrings
    - ☑️ connections.py: Module, Classes, Methods and by Docstrings
    MINOR
    - ☑️ modelview.py: Module, Classes, Methods and by Docstrings
    - ☑️ sidecar.py: Module, Classes, Methods and by Docstrings
    - ☑️ settings.py: Module, Classes, Methods and by Docstrings
    - ☑️ exceptions.py: Module, Classes, Methods and by Docstrings
    - ☑️ commands.py: Module, Classes, Methods and by Docstring
### Linted June 3rd
    - ☑️ PASSING: Pep8 Linter: pycodestye: Passing, with exception of W293, ignored
      - https://pep8ci.herokuapp.com/
    - ☑️ PyCharm: Python: Passing with additional noqa usage
       - Weak Warning:  Ln 197, Exception.py
    - PyLint: Passing
    - MyPy: Not Passing.
            Major efforts, but suffice for now.
    - ☑️ Ruff: Increase in noqa and ignored issues
      -  But is Passing of what is not ignored
    - NOQA: Ignoring lint issues
      - Use of noqa:
        - Causes: Either IDE complains that couldn't be fixed, or costly to fix a small effort.
        - Causes: Convention Breakage:
                  No sense to stay in coding style, deviation to own coding style.
        - Causes: Other linters have caught more serious issues, these are fluff issues.
### Disabled
### Fixed
### Fixme (Code)
### Todo (Task)
### Style
    ✔️Classes: Use basic templates, static method decorators, some pure classes
    ✔️Linting: resolving static analysis, static types -> Testing
    ✔️Typing: Use of TypeHints, and typed returns -> Testing
    ✔️Testing:
         ✔️ 1) Locally in IDE, Partial by Mon 22 at 6:30pm
         ✔️ 2) Heroku flow/CI: Monday 22nd May
         3) Heroku App
     ✔️ Validation: Needs to have user inputs (4.3) ready.
        - ️ ☑️ selective as some jank with click.prompts/options already check for types, and options can constrain choice
        - ☑️ there are type checks for all input vars, with default as strings
        - ☑️ There are no constraints on the data patterns / forms needing regex.
        - ☑️ limited inputs at this MVP stage
     ✔️ DataModel
        - ☑️ Current setting up a datamodel to
          ☑️ i) Load to a Panda's dataframe
          ☑️ ii) Load a filtered view of a dataframe (selected columns as Views)
          ☑️ iii) Load a single dataset, a Panda Series, as a single record
          ☑️ iv) Find a single, as above, and display as a Card view
          ☑️ v) Use same find algorithm, to Edit (insert, append, clear) same data record
             a) single record modifiable fields are Notes, and maybe ToDo.
          ☑️ vi) View the modified record
### Design
### Planned
    -️ ☑️️ Stage 1: prepare core utils and remote capacities as Classes etc -* Currently
    - ️️☑️️ Stage 2 research and prepare console shell design:
         - ☑️ Update: using rich.* and it is working
    - ️☑️️ Stage 3: Setup Heroku App, document (readme.md 7.3) and get print hello to web interface
    - ☑️ Stage 4: Develop data model and logic models for front end/local
       - connection.py
         - CLASS: GOOGLECONNECTOR: Load data by API/Framework
       - controller.py for
         - ☑️CLASS: CONTROLLER, DATA CONTROLLER: controller/load bulk data logic,
         - ☑️CLASS: COLUMNSCHEMA, HEADERS: data views (subsets),
         - ☑️CLASS: DISPLAY, INNER, WEBCONSOLE: display (version 1)
         - ☑️CLASS: RECORD: individual dataset, and view/display console/tables
         - ☑️CLASS: EDITOR: CUD/Modify ops:  ☑️ Create/Add/Insert,  ☑️Update/Append,  ☑️Delete/Clear, Save/Commit
       - app.py
         - ☑️CLASS: VIEW, WINDOW, CRITERIAAPP, CHECKS, RESULTS
           ☑️ 4.1: ☑️READING, ☑️FILTERING, ☑️DISPLAYING - @2023-05/18
         ️️ ☑️ 4.2: ☑️FINDING, ☑️LOCATING BT INDEX, ☑️FOCUSING -@2023-05-19
                - ☑️ FIND: Locate by index of a record ONLY
         ☑️️ 4.3: ⏸INPUTING, DELETING
               - STATUS: CODED☑️,Testing Monday 22nd Add a note @ 17:30
                 - Notes, Todo
         ☑️ 4.4: UPDATING, APPENDING, MODIFYING
               - STATUS: Coded ☑️, Testing
          4.5: COMMITTING AND VERIFICATION.
           - Has the changes been committed safely
     Logic Flow
         ☑️️  1 User reads information ☑️️  fetched for different views ☑️️ or browse pages
         ☑️ 2 User searches/select/filters information to edit/create
         ☑️️ 3 User inputs/updates/clears information based on selection
         ☑️️ 4 User commits saves to the list
         ☑️️  5 User made a mistake, deletes a recorf
BREAKING CHANGE:

### Closed: Issues
  • Loading branch information
iPoetDev committed Jun 3, 2023
1 parent 4ca7f7b commit 3a0708e
Show file tree
Hide file tree
Showing 8 changed files with 225 additions and 145 deletions.
Binary file added .docs/assets/WebApp-EditDisplay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/assets/WebApp-EditNotes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/assets/WebApp-EditProgress.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/assets/WebApp-FindLocate1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .docs/assets/WebApp-FindLocate2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 53 additions & 17 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ def checkcommand(mode: str) \
return None
else:
return None

@staticmethod
def isinrange(index) -> bool:
"""Check if index is in range."""
return True if 1 <= index <= App.get_range else False


class Window:
Expand Down Expand Up @@ -1064,14 +1069,23 @@ def locate(ctx: click.Context, index: int,
:param axis: str: The axis to search in: Default: index
:return: None: Display as stdout or stderr
"""
validindex = 1
if not Valid.isinrange(index):
click.secho(message="Index out of range",
fg=styles.warnfg,
bold=styles.warnbg)
return
else:
validindex = index

# Get the dataframe
dataframe: pd.DataFrame = App.get_data()
# If the axis is index, -a, --axis, then search the index
if axis.lower() == 'index':
if axis.lower() == 'index' and Valid.isinrange(index):
# Get the result source
resultframe = \
Results.getrowdata(data=dataframe,
ix=index)
ix=validindex)

# Check if the result is a single record
if Record.checksingle(resultframe):
Expand All @@ -1090,10 +1104,11 @@ def locate(ctx: click.Context, index: int,
fg=styles.warnfg,
bold=styles.warnbold) # noqa
else:
click.secho(message="Command did not run. Axes not implemented",
err=styles.toerror,
fg=styles.errfg,
bold=styles.errbold) # noqa
click.secho(message="Try again, and use: \n"
"-i/--index and a number value between"
f" 1 and {App.get_range}\n"
"and axes: index",
fg='bright_yellow', bold=True)
# Update appdata data
App.update_appdata(context=ctx, dataframe=dataframe)

Expand Down Expand Up @@ -1222,13 +1237,22 @@ def notepad(ctx,
# Rehydrtate dataframe from remote
dataframe: pd.DataFrame = App.get_data()

validindex = 1
if not Valid.isinrange(index):
click.secho(message="Row does not exit. Try again",
fg=styles.warnfg,
bold=styles.warnbg)
return
else:
validindex = index
# - Check the index search focus (i.e. dimenson). Default: index
# Only one dimension, i.e axis, is implemented: index,
# Others are column, row: Future implementation.
if axis.lower() == App.values.SEARCHFOCUS and note:
if axis.lower() == App.values.SEARCHFOCUS and note \
and Valid.isinrange(index):
# - Get the record
resultframe = Results.getrowdata(data=dataframe,
ix=index,
ix=validindex,
debug=App.values.NOTRACING)
if Record.checksingle(resultframe) and note is not None:
# - Display the found result and - send to the editor
Expand All @@ -1248,7 +1272,7 @@ def notepad(ctx,
is not None else ''
editor.editdisplay = f'Edit: > Note in {mode} mode'
# - Edit note field of the record
if index is not None:
if index is not None and Valid.isinrange(index):
click.secho(
message="=====================================",
bg='white',
Expand All @@ -1258,8 +1282,8 @@ def notepad(ctx,
# Edit Mode for Notes:
# Action/Tasks: Add/Insert, Update/Append, Delete/Clear
editor.editnote(edits=Valid.checkmode(edits=mode,
index=index),
index=index,
index=validindex),
index=validindex,
notepad=note,
debug=App.values.NOTRACING)
else:
Expand Down Expand Up @@ -1290,7 +1314,8 @@ def notepad(ctx,
click.secho(message="Try again, and use: \n"
"-m/--mode and select edit action: "
"add, update, delete\n"
"-i/--index and a number value\n"
"-i/--index and a number value between"
f" 1 and {App.get_range}\n"
"and axes: index",
fg='bright_yellow', bold=True)

Expand Down Expand Up @@ -1341,13 +1366,23 @@ def progress(ctx: click.Context,
# Debugging Flags
dataframe: pd.DataFrame = App.get_data()
editmode = App.values.Edit.ToDo.SELECT

validindex = 1
if not Valid.isinrange(index):
click.secho(message="Row does not exit. Try again",
fg=styles.warnfg,
bold=styles.warnbg)
return
else:
validindex = index
# Check the index search focus (i.e. dimenson). Default: index
# Only one dimension, i.e axis, is implemented: index,
# Others are column, row: Future implementation.
if axis.lower() == App.values.SEARCHFOCUS and status:
if axis.lower() == App.values.SEARCHFOCUS and status \
and Valid.isinrange(index):
# - Get the record
resultframe = Results.getrowdata(data=dataframe,
ix=index,
ix=validindex,
single=App.values.SINGLE,
debug=App.values.NOTRACING)
if Record.checksingle(resultframe) \
Expand All @@ -1370,7 +1405,7 @@ def progress(ctx: click.Context,
editor.editdisplay = f'Edit: > Progress in report mode'
editor.command = Valid.checkcommand(mode='select')
# - Edit note field of the record
if index is not None:
if index is not None and Valid.isinrange(index):
click.secho(
message="=================1====================",
bg='white',
Expand All @@ -1384,7 +1419,7 @@ def progress(ctx: click.Context,
# instead of Option
# Due to issues with callbacks and the REPL features
editor.editprogress(edits=editmode,
index=index,
index=validindex,
choicepad=Valid.checkstatus(status),
debug=App.values.NOTRACING)
else:
Expand Down Expand Up @@ -1416,7 +1451,8 @@ def progress(ctx: click.Context,
click.secho(message="Try again, and use: \n"
"-m/--mode and select edit action: "
"add, update, delete\n"
"-i/--index and a number value\n"
"-i/--index and a number value between"
f" 1 and {App.get_range}\n"
"and axes: index",
fg='bright_yellow', bold=True)

Expand Down
Loading

0 comments on commit 3a0708e

Please sign in to comment.