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

feature/5-6-version-interpretation-select into develop #10

Merged
merged 5 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ init-hook='''
import os, sys;
sys.path.append(os.path.dirname(find_pylintrc()));
'''
max-args=10
max-locals=20
max-args=15
max-locals=25
fail-on=
useless-suppression,

Expand Down
29 changes: 28 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,23 @@ Compare to [stable](https://github.com/VoltServer/UL1400-1_analyzer/compare/stab
- [Added] `.mypy.ini` added to configure `mypy` execution for app code and test
code ([#1][]).
- [Added] `max-locals` set to `20` ([#4][]).
- [Changed] `max-locals` increased from `20` to `25` to balance out the
`max-args` being increased from `10` to `15` ([#5][], [#6][]).


### Analysis: Analyzer Support
- [Added] `analyzer_support.py` added for shared data and functionality among
analyzers, which for now is `Interpretation` and `StandardVersion` enums
with defaults defined ([#5][], [#6][]).


### Analysis: Letgo Analyzer
- [Added] `letgo_analyzer.py` added with ability to analyze waveforms strictly
to UL1400-1 with parallel CPU core processing support ([#4][]).
- [Added] Audit function added to check if the configuration used is critically
valid for UL1400-1 assessment ([#5][], [#6][]).
- [Changed] Current and voltage let-go assessments now performed with the
interpretation level and standard version factored in ([#5][], [#6][]).


### Data Import: Data Importer
Expand All @@ -91,6 +103,11 @@ Compare to [stable](https://github.com/VoltServer/UL1400-1_analyzer/compare/stab
in CLI help messages ([#4][]).


## Utils: CLI:
- [Added] `cli.py` added for CLI processing support, with case-insensitive enum
option parsing implemented ([#5][], [#6][]).


## Utils: Waveform
- [Added] `waveform.py` added to encapsulate generic waveform manipulations,
such as extracting segments and merging regions ([#4][]).
Expand All @@ -99,6 +116,8 @@ Compare to [stable](https://github.com/VoltServer/UL1400-1_analyzer/compare/stab
### Main
- [Added] `main.py` added with CLI sub-parser for letgo and help function to
route CLI args to letgo analyzer as well as display results ([#4][]).
- [Added] Support for interpretation level and standard version CLI args added
along with the usage and audit for those parameters ([#5][], [#6][]).


### Version
Expand All @@ -115,7 +134,9 @@ Compare to [stable](https://github.com/VoltServer/UL1400-1_analyzer/compare/stab
### Docs: CONTRIBUTING
- [Added] `CONTRIBUTING.md` added to project root, covering dev setup, general
workflow, and conventions ([#1][]).

- [Added] Added convention that exceptions will be raised if an unsupported
interpretation or standard version encountered in a function that uses
that configuration ([#5][], [#6][]).

### Docs: README
- [Changed] Updated with project intro (mostly placeholder), links, CI badge
Expand All @@ -138,12 +159,15 @@ Compare to [stable](https://github.com/VoltServer/UL1400-1_analyzer/compare/stab
#### Issues
- [#1][]
- [#4][]
- [#5][]
- [#6][]
- [#7][]

#### PRs
- [#2][] for [#1][]
- [#8][] for [#7][]
- [#9][] for [#4][]
- [#10][] for [#5][], [#6][]

---

Expand All @@ -153,7 +177,10 @@ Reference-style links here (see below, only in source) in develop-merge order.
[#1]: https://github.com/VoltServer/UL1400-1_analyzer/issues/1 'Issue #1'
[#7]: https://github.com/VoltServer/UL1400-1_analyzer/issues/7 'Issue #7'
[#4]: https://github.com/VoltServer/UL1400-1_analyzer/issues/4 'Issue #4'
[#5]: https://github.com/VoltServer/UL1400-1_analyzer/issues/5 'Issue #5'
[#6]: https://github.com/VoltServer/UL1400-1_analyzer/issues/6 'Issue #6'

[#2]: https://github.com/VoltServer/UL1400-1_analyzer/pull/2 'PR #2'
[#8]: https://github.com/VoltServer/UL1400-1_analyzer/pull/8 'PR #8'
[#9]: https://github.com/VoltServer/UL1400-1_analyzer/pull/9 'PR #9'
[#10]: https://github.com/VoltServer/UL1400-1_analyzer/pull/10 'PR #10'
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ development, it is most likely that `dev-required` is the correct arg.

# Conventions

## Interpretation and Standard Version Support
In some parts of this project, different decisions are made depending on which
version of the standard is being used as well as the interpretation level that
is allowed. Any function that acts on either of these parameters MUST include
a check that raises an exception if any option other than those supported at the
time of development is provided.


## Logger
Balancing readability against performance, the pylint warnings
`logging-fstring-interpolation` and `logging-not-lazy` are disabled. The
Expand Down
1 change: 1 addition & 0 deletions ul1400_1_analyzer/analysis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# pylint: disable=missing-module-docstring
__all__ = [
'analyzer_support',
'letgo_analyzer',
]
54 changes: 54 additions & 0 deletions ul1400_1_analyzer/analysis/analyzer_support.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
This encapsulates any generic supporting elements that may be required by more
than 1 analyzer module.

Module Attributes:
DEFAULT_INTERPRETATION: The default interpretation level to be used by this
project.
DEFAULT_STANDARD_VERSION: The default version of the standard to be used by
this project.
LATEST_STANDARD_VERSION: The latest released version of the standard.
"""
from __future__ import annotations
from enum import Enum



class Interpretation(Enum):
"""
These are the "levels" of how the standard should be interpreted, ranging
from a strict adherence to everything exactly as it is written to
speculative attempts to resolve ambiguous, conflicting, or absent material.
Higher levels should be used with increased caution, as they are at greater
risk of not being the official final interpretation per the standards body.
"""
STRICT = 'Level 0: This only allows interpretations strictly adhering to' \
' the exact language in the standard.'
TYPOS = 'Level 1: This allows provable typos in the standard to be fixed' \
' and used in the analysis.'
REASONABLE = 'Level 2: This allows ambiguous, conflicting, or absent' \
' material from the standard to be resolved where a reasonably' \
' confident interpretation is possible. This should be something' \
' where arguments can be constructed based on other parts of the' \
' the standard or the referenced literature. This also' \
' incorporates previous levels where possible.'
SPECULATIVE = 'Level 3: This allows for experimental and other wildly' \
' speculative interpretations to be explored as solutions to' \
' ambiguous, conflicting, or absent material that cannot' \
' otherwise be proven with reasonable confidence. This also' \
' incorporates previous levels where possible.'



class StandardVersion(Enum):
"""
The supported versions of the standard that can be analyzed against.
"""
UL1400_1_ISSUE_1 = 'UL1400-1, Issue Number 1; December 19, 2022'



DEFAULT_INTERPRETATION = Interpretation.STRICT

LATEST_STANDARD_VERSION = StandardVersion.UL1400_1_ISSUE_1
DEFAULT_STANDARD_VERSION = LATEST_STANDARD_VERSION
Loading