diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 0ec5b8af9..08915f70e 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -28,15 +28,11 @@
-
+
+
-
-
-
-
-
-
+
@@ -133,66 +129,67 @@
- {
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "Git.Branch.Popup.ShowAllRemotes": "true",
- "MATLAB_INTERPRETER": "/usr/local/MATLAB/R2018a/bin/matlab",
- "Python tests.Nosetests for test_power_flow.test_zip.executor": "Debug",
- "Python tests.Nosetests for tests.test_hydro.executor": "Run",
- "Python tests.Nosetests for tests.test_opf_time_series.test_opf_ts.executor": "Run",
- "Python tests.Nosetests for tests.test_topology_processor.executor": "Run",
- "Python tests.Nosetests in admittance_matrix_test.py.executor": "Run",
- "Python tests.Nosetests in deep_copy_test.py.executor": "Run",
- "Python tests.Nosetests in tests.executor": "Run",
- "Python tests.pytest for src.tests.test_cgmes_ieeee.test_iee14_cgmes.executor": "Run",
- "Python tests.pytest for src.tests.test_cgmes_to_gridcal_ac_transformers.test_ac_transformers3w_only_two_terminals_log_error.executor": "Debug",
- "Python tests.pytest for src.tests.test_generator_q_control.test_q_control_true.executor": "Run",
- "Python tests.pytest for src.tests.test_load_all_grids.test_line_templates_finding.executor": "Run",
- "Python tests.pytest for src.tests.test_ptdf.executor": "Run",
- "Python tests.pytest for src.tests.test_raw_roundtrip.test_rawx_roundtrip.executor": "Run",
- "Python tests.pytest for src.tests.test_simple_mip.executor": "Run",
- "Python tests.pytest for src.tests.test_topology_processor.test_topology_NL_microgrid.executor": "Run",
- "Python tests.pytest for test_grid_diff.test_add_stuff_roundtrip.executor": "Run",
- "Python tests.pytest for test_ntc.test_ntc_ieee_14.executor": "Run",
- "Python tests.pytest in test_cgmes_roundtrip.py.executor": "Run",
- "Python tests.pytest in test_load_all_grids.py.executor": "Run",
- "Python tests.pytest in test_ntc.py.executor": "Run",
- "Python tests.pytest in test_ptdf.py.executor": "Run",
- "Python tests.pytest in test_simple_mip.py.executor": "Run",
- "Python tests.pytest in tests.executor": "Run",
- "Python.AnalysisDialogue.executor": "Run",
- "Python.ExecuteGridCal.executor": "Run",
- "Python.cgmes_rdfs_graph.executor": "Run",
- "Python.file opening.executor": "Run",
- "Python.make.executor": "Run",
- "Python.new_circuit_objects.executor": "Run",
- "Python.node_widget.executor": "Run",
- "Python.nr_improvement_on_ill_conditioned_grid.executor": "Run",
- "Python.ntc_example.executor": "Debug",
- "Python.pymoo_example.executor": "Debug",
- "Python.run.executor": "Run",
- "Python.solar_power_wizzard.executor": "Run",
- "Python.transformer3w_editor.executor": "Run",
- "Python.transformer_psse.executor": "Run",
- "Python.update_gui_file (1).executor": "Run",
- "Python.update_gui_file.executor": "Run",
- "Python.upload_to_pypi.executor": "Run",
- "RunOnceActivity.OpenProjectViewOnStart": "true",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "WebServerToolWindowFactoryState": "false",
- "git-widget-placeholder": "199__finalize__cgmes__import",
- "last_opened_file_path": "/home/santi/Documentos/Git/GitHub/GridCal/src/GridCalEngine/Utils/ThirdParty/nptyping",
- "node.js.detected.package.eslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "run.code.analysis.last.selected.profile": "aDefault",
- "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
- "two.files.diff.last.used.file": "C:/WorkProjects/PycharmProjects/GridCal/src/trunk/cgmes_py_generator/cgmes_v2_4_15/cgmes_enums.py",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
@@ -219,7 +216,7 @@
-
+
@@ -486,6 +483,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -650,24 +670,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -687,19 +689,19 @@
+
-
+
-
@@ -1424,7 +1426,7 @@
-
+ 1656059954202
@@ -1769,7 +1771,7 @@
1698766404661
-
+
@@ -1803,7 +1805,6 @@
-
@@ -1828,7 +1829,8 @@
-
+
+
@@ -2610,7 +2612,7 @@
-
+
diff --git a/README.md b/README.md
index 185e41b82..7d905824f 100755
--- a/README.md
+++ b/README.md
@@ -1138,6 +1138,55 @@ reply_from_server = asyncio.get_event_loop().run_until_complete(
print(reply_from_server)
```
+
+
+
+## Tests
+
+**GridCal** uses pytest for automatic software testing.
+
+If you make changes to **GridCal** that you plan to submit, first make sure that all
+tests are still passing. You can do this locally with `pytest`.
+
+If you have added new functionality, you should also add a new function that tests this
+functionality. pytest automatically detects all functions in the `src/tests` folder
+that start with `test_` and are located in a file that also starts with `test_` as
+relevant test cases. Unit test (for pytest) are included in `src/tests`. As defined in `pytest.ini`, all
+files matching `test_*.py` are executed by running `pytest`.
+
+
+Files matching `*_test.py` are not executed; they were not formatted specifically for
+`pytest` but were mostly done for manual testing and documentation purposes.
+
+Additional tests should be developped for each new and existing feature. `pytest`
+should be run before each commit to prevent easily detectable bugs.
+
+
+## Bug reporting
+
+You have found a bug in **GridCal** or have a suggestion for a new functionality? Then
+get in touch with us by opening up an issue on the [issue board](https://github.com/SanPen/GridCal/issues) to discuss possible new
+developments with the community and the maintainers.
+
+## Contributing
+
+All contributions to the **GridCal** repository are made through pull requests to the
+`master` branch. You can either submit a pull request from the develop branch of your
+fork or create a special feature branch that you keep the changes on. A feature branch
+is the way to go if you have multiple issues that you are working on in parallel and
+want to submit with seperate pull requests. If you only have small, one-time changes
+to submit, you can also use the `master` branch to submit your pull request.
+
+However, it is best to discuss your contribution before the pull request is ready to be officially
+submitted. We only accept high quality contributions that align with the project design.
+Those are heavily reviewed, and you may expect joint work with us if your proposal is deemed good enough.
+
+An alternative, maybe easier way to contribute functionality to GridCal, is to use the objects
+and functions to produce your contribution in a script-like fashion.
+Again, if that meets the functional and quality standards that we impose, we'll take care of the integration.
+
+All contributions must come with testing.
+
## Contact
- Join the [Discord GridCal channel](https://discord.com/invite/dzxctaNbvu) for a friendly chat, or quick question.
diff --git a/doc/conf.py b/doc/conf.py
index 207f0126f..3a3f21b66 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -23,8 +23,8 @@
# -- Project information -----------------------------------------------------
project = 'GridCal'
-copyright = '2024, Santiago Peñate Vera'
-author = 'Santiago Peñate Vera'
+copyright = '2024, Santiago Peñate Vera et. al.'
+author = 'Santiago Peñate Vera et. al.'
# The full version, including alpha/beta/rc tags
release = __GridCalEngine_VERSION__
diff --git a/src/GridCalEngine/__init__.py b/src/GridCalEngine/__init__.py
index 73bc2ff3e..4727fea1c 100644
--- a/src/GridCalEngine/__init__.py
+++ b/src/GridCalEngine/__init__.py
@@ -4,13 +4,16 @@
# SPDX-License-Identifier: MPL-2.0
from __future__ import annotations
-from GridCalEngine.basic_structures import *
-from GridCalEngine.Simulations import *
-from GridCalEngine.IO import *
-from GridCalEngine.Devices import *
-from GridCalEngine.DataStructures import *
-from GridCalEngine.Topology import *
-from GridCalEngine.enumerations import *
+try:
+ from GridCalEngine.basic_structures import *
+ from GridCalEngine.Simulations import *
+ from GridCalEngine.IO import *
+ from GridCalEngine.Devices import *
+ from GridCalEngine.DataStructures import *
+ from GridCalEngine.Topology import *
+ from GridCalEngine.enumerations import *
+except ModuleNotFoundError as e:
+ print("Modules not found :/", e)
def open_file(filename: Union[str, List[str]]) -> MultiCircuit:
diff --git a/src/trunk/download_stats.py b/src/trunk/download_stats.py
index 73106bd05..da2f4195a 100644
--- a/src/trunk/download_stats.py
+++ b/src/trunk/download_stats.py
@@ -1,19 +1,7 @@
-# GridCal
-# Copyright (C) 2022 Santiago Peñate Vera
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 3 of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at https://mozilla.org/MPL/2.0/.
+# SPDX-License-Identifier: MPL-2.0
"""
@@ -110,15 +98,31 @@ def downloads(self, force=False):
return self._downloads
def total(self):
+ """
+
+ :return:
+ """
return sum(self.downloads.values())
def average(self):
+ """
+
+ :return:
+ """
return self.total() / len(self.downloads)
def max(self):
+ """
+
+ :return:
+ """
return max(self.downloads.values())
def min(self):
+ """
+
+ :return:
+ """
return min(self.downloads.values())
def stats(self):
@@ -154,6 +158,9 @@ def stats(self):
def main():
+ """
+
+ """
pkg = 'GridCal'
PyPIDownloadAggregator(pkg).stats()