Skip to content

Commit

Permalink
Avoid useless nesting of folders
Browse files Browse the repository at this point in the history
  • Loading branch information
alihamdan committed Nov 29, 2024
1 parent df7ef47 commit 29e3046
Show file tree
Hide file tree
Showing 15 changed files with 198 additions and 39 deletions.
94 changes: 94 additions & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
// Version of the setting file. Always 0.2
"version": "0.2",
// language - current active spelling language
"language": "en,fr",
// words - list of words to be always considered correct
"words": [
"abcn",
"absolufy",
"acsr",
"aldrey",
"asarray",
"astype",
"bline",
"bnline",
"bnpline",
"bysource",
"cohl",
"cosgini",
"cterm",
"curmg",
"cython",
"direc",
"dline",
"dropna",
"dtype",
"elmlodmv",
"elmpvsys",
"furo",
"gpslat",
"gpslon",
"gscale",
"htmlcov",
"ilini",
"imiso",
"inom",
"isort",
"mathjax",
"mathrm",
"mlei",
"nbsphinx",
"ndarray",
"nlnph",
"nneutral",
"noloadloss",
"normhkva",
"nphase",
"nphases",
"nplin",
"opendss",
"pcutr",
"pgini",
"phasor",
"phasors",
"phtech",
"pipx",
"plini",
"pmatrix",
"pmax",
"pyproj",
"pyproject",
"pytest",
"pyupgrade",
"qgini",
"qlini",
"qurs",
"raphson",
"rline",
"rnline",
"rnpline",
"rtol",
"sgini",
"slini",
"strn",
"susceptance",
"transfo",
"uknom",
"uktr",
"ureg",
"utrn",
"xline",
"xlpe",
"xnet",
"xnline",
"xnpline",
"yesqa"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": [
"hte"
]
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"charliermarsh.ruff",
"esbenp.prettier-vscode",
"ms-python.python",
"ms-python.vscode-pylance",
],
}
33 changes: 33 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Jupyter Notebook
"jupyter.notebookFileRoot": "${workspaceFolder}",
"notebook.formatOnSave.enabled": true,
"notebook.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit",
},

// Python
"python.analysis.diagnosticSeverityOverrides": {
"reportInvalidStringEscapeSequence": "warning",
"reportImportCycles": "warning",
"reportUnusedImport": "warning",
},
"python.testing.pytestEnabled": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit",
},
},
// Prettier
"prettier.printWidth": 120,
"[markdown][yaml][html][css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
},
// Json
"[json]": {
"editor.indentSize": 2,
},
}
44 changes: 44 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": { "cwd": "${workspaceFolder}" },
"presentation": {
"showReuseMessage": true,
"clear": true,
},
"tasks": [
{
"label": "Build docs",
"detail": "Build the docs using Sphinx.",
"type": "shell",
"command": "make -C doc html",
"group": {
"kind": "build",
"isDefault": true,
},
"problemMatcher": [],
"presentation": {
"reveal": "silent",
"focus": true,
},
},
{
"label": "Open docs",
"detail": "Open the docs in the browser.",
"type": "shell",
"command": "open build/html/index.html",
"presentation": {
"reveal": "never",
"close": true,
"focus": false,
"panel": "dedicated",
},
"group": {
"kind": "build",
"isDefault": true,
},
"isBackground": true,
},
],
}
18 changes: 10 additions & 8 deletions roseau/load_flow_single/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@
__status__,
__url__,
)
from roseau.load_flow_single.models.branches import AbstractBranch
from roseau.load_flow_single.models.buses import Bus
from roseau.load_flow_single.models.core import Element
from roseau.load_flow_single.models.lines import Line, LineParameters
from roseau.load_flow_single.models.loads import (
from roseau.load_flow_single.models import (
AbstractBranch,
AbstractLoad,
Bus,
Control,
CurrentLoad,
Element,
FlexibleParameter,
ImpedanceLoad,
Line,
LineParameters,
PowerLoad,
Projection,
Switch,
Transformer,
TransformerParameters,
VoltageSource,
)
from roseau.load_flow_single.models.sources import VoltageSource
from roseau.load_flow_single.models.switches import Switch
from roseau.load_flow_single.models.transformers import Transformer, TransformerParameters
from roseau.load_flow_single.network import ElectricalNetwork

__version__ = importlib.metadata.version("roseau-load-flow-single")
Expand Down
17 changes: 6 additions & 11 deletions roseau/load_flow_single/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
from roseau.load_flow import Projection, TransformerParameters
from roseau.load_flow_single.models.branches import AbstractBranch
from roseau.load_flow_single.models.buses import Bus
from roseau.load_flow_single.models.core import Element
from roseau.load_flow_single.models.lines import Line, LineParameters
from roseau.load_flow_single.models.loads import (
AbstractLoad,
Control,
CurrentLoad,
FlexibleParameter,
ImpedanceLoad,
PowerLoad,
Projection,
)
from roseau.load_flow_single.models.flexible_parameters import Control, FlexibleParameter
from roseau.load_flow_single.models.line_parameters import LineParameters
from roseau.load_flow_single.models.lines import Line
from roseau.load_flow_single.models.loads import AbstractLoad, CurrentLoad, ImpedanceLoad, PowerLoad
from roseau.load_flow_single.models.sources import VoltageSource
from roseau.load_flow_single.models.switches import Switch
from roseau.load_flow_single.models.transformers import Transformer, TransformerParameters
from roseau.load_flow_single.models.transformers import Transformer

__all__ = [
"Element",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from roseau.load_flow_engine.cy_engine import CyShuntLine, CySimplifiedLine
from roseau.load_flow_single.models.branches import AbstractBranch
from roseau.load_flow_single.models.buses import Bus
from roseau.load_flow_single.models.lines.parameters import LineParameters
from roseau.load_flow_single.models.line_parameters import LineParameters

logger = logging.getLogger(__name__)

Expand Down
4 changes: 0 additions & 4 deletions roseau/load_flow_single/models/lines/__init__.py

This file was deleted.

File renamed without changes.
5 changes: 0 additions & 5 deletions roseau/load_flow_single/models/loads/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions roseau/load_flow_single/models/transformers/__init__.py

This file was deleted.

5 changes: 2 additions & 3 deletions roseau/load_flow_single/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
from roseau.load_flow.utils.types import _DTYPES, LoadTypeDtype
from roseau.load_flow_engine.cy_engine import CyElectricalNetwork, CyGround, CyPotentialRef
from roseau.load_flow_single.io import network_from_dict, network_to_dict
from roseau.load_flow_single.models import Transformer
from roseau.load_flow_single.models.branches import AbstractBranch
from roseau.load_flow_single.models.buses import Bus
from roseau.load_flow_single.models.core import Element
from roseau.load_flow_single.models.lines import Line
from roseau.load_flow_single.models.loads import AbstractLoad, PowerLoad
from roseau.load_flow_single.models.loads.loads import CurrentLoad, ImpedanceLoad
from roseau.load_flow_single.models.loads import AbstractLoad, CurrentLoad, ImpedanceLoad, PowerLoad
from roseau.load_flow_single.models.sources import VoltageSource
from roseau.load_flow_single.models.switches import Switch
from roseau.load_flow_single.models.transformers import Transformer

if TYPE_CHECKING:
from networkx import Graph
Expand Down

0 comments on commit 29e3046

Please sign in to comment.