Skip to content

Commit

Permalink
more linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
noah80 committed Mar 15, 2023
1 parent b462959 commit 94e5281
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 125 deletions.
182 changes: 91 additions & 91 deletions .github/workflows/eradicate.yml
Original file line number Diff line number Diff line change
@@ -1,91 +1,91 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: eradicate_flake8

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8-eradicate
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Lint with flake8
working-directory: ./
run: |
flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
- name: Lint with flake8
working-directory: ./
run: |
flake8 examples/basic_household.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 examples/basic_household_only_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 examples/default_connections.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 examples/dynamic_components.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 examples/simple_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/component_wrapper.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/dynamic_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/hisim_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/hisim_with_profiler.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/json_executor.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/json_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/loadtypes.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/log.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessingoptions.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/project_code_overview_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/simulationparameters.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/simulator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/sim_repository.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/utils.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/controller_l1_building_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/controller_l1_generic_runtime.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/controller_l1_heatpump.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/controller_l2_generic_heat_simple.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/components/generic_hot_water_storage_modular.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/modular_household/interface_configs/system_config.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/chartbase.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/charts.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/chart_singleday.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/postprocessing_datatransfer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/postprocessing_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/reportgenerator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 hisim/postprocessing/system_chart.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/functions_for_testing.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_advanced_battery_bslib.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_basic_household_with_all_resultfiles.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
flake8 tests/test_example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# reenable once all source files are fixed and no more commented out code is spread all over
# flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# # stop the build if there are Python syntax errors or undefined names
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
## This workflow will install Python dependencies, run tests and lint with a single version of Python
## For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
#
#name: eradicate_flake8
#
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
#
#jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python 3.10
# uses: actions/setup-python@v3
# with:
# python-version: "3.10"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8-eradicate
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# pip install -e .
# - name: Lint with flake8
# working-directory: ./
# run: |
# flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# - name: Lint with flake8
# working-directory: ./
# run: |
# flake8 examples/basic_household.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 examples/basic_household_only_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 examples/default_connections.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 examples/dynamic_components.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 examples/simple_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/component_wrapper.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/dynamic_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/hisim_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/hisim_with_profiler.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/json_executor.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/json_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/loadtypes.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/log.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessingoptions.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/project_code_overview_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/simulationparameters.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/simulator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/sim_repository.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/utils.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_building_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_generic_runtime.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_heatpump.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l2_generic_heat_simple.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/generic_hot_water_storage_modular.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/modular_household/interface_configs/system_config.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/chartbase.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/charts.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/chart_singleday.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/postprocessing_datatransfer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/postprocessing_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/reportgenerator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/system_chart.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/functions_for_testing.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_advanced_battery_bslib.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_basic_household_with_all_resultfiles.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
#
#
#
#
## reenable once all source files are fixed and no more commented out code is spread all over
## flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# # # stop the build if there are Python syntax errors or undefined names
#
# # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
3 changes: 2 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ disable=raw-checker-failed,
duplicate-code,
fixme,
no-member,
broad-exception-raised
broad-exception-raised,
consider-using-generator

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
2 changes: 1 addition & 1 deletion examples/dynamic_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def dynamic_components_demonstration(
my_simulation_parameters=my_simulation_parameters,
config=my_advanced_fuel_cell_config_2,
)
my_cl2_config = cl2.EMSConfig.get_default_config_EMS()
my_cl2_config = cl2.EMSConfig.get_default_config_ems()
my_cl2 = cl2.L2GenericEnergyManagementSystem(
my_simulation_parameters=my_simulation_parameters, config=my_cl2_config
)
Expand Down
2 changes: 1 addition & 1 deletion examples/modular_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def modular_household_explicit(
water_heating_system_installed,
):
my_electricity_controller_config = (
controller_l2_energy_management_system.EMSConfig.get_default_config_EMS()
controller_l2_energy_management_system.EMSConfig.get_default_config_ems()
)
my_electricity_controller = (
controller_l2_energy_management_system.L2GenericEnergyManagementSystem(
Expand Down
Loading

0 comments on commit 94e5281

Please sign in to comment.