Package: plot-serializer
Overview[[TOC]]InstallationInstall Plot Serializer with pip:pip install plot-serializerContributingClone this repository withgit clone git@git.rwth-aachen.de:rdm-tools/plot-serializer.gitCreating the virtual environmentOn Windows, runpy -m venv envThe second argument is the location to create the virtual environment. Generally, you can just create this in your project and call it env.venv will create a virtual Python installation in the env folder.Before you can start installing or using packages in your virtual environment you’ll need to activate it. Activating a virtual environment will put the virtual environment-specific python and pip executables into your shell’s PATH..\env\Scripts\activateYou can confirm you’re in the virtual environment by checking the location of your Python interpreter:where pythonTell pip to install all of the packages in therequirements.txtfile using the -r flag:py -m pip install -r requirements.txtUpdate therequirements.txtfile when you install new packages.For more detailed instructions, checkhttps://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/.LintingThis project uses theflake8linter and theblackautoformatter.DocumentationDocumentation is an essential part of writing code.:warning: All public functions, methods, classes and modules must be properly documented with docstrings.This project usesgoogle-style docstrings. An example for a good docstring:deffind_largest_distance(point,polygon):"""Finds the largest distance between a point and the edges of a polygon.Args:point (shapely.geometry.Point): shapely point objectpolygon (shapely.geometry.Polygon): shapely polygon objectReturns:float: the largest distance between a point and the edges of a polygon"""distance_list=np.array([])forpoly_pointinlist(zip(*polygon.exterior.coords.xy)):distance=point.distance(Point(poly_point))distance_list=np.append(distance_list,distance)max_distance=max(distance_list)returnmax_distancebecause:short and easy to understand descriptionstarts with a verb in third persontypeof the args are givenargs and returns are described sufficientlyWhere necessary, add additional information using comments.Naming ConventionFollowGuido's recommendations (taken fromGoogle Python Styleguide):TypePublicInternalPackageslower_with_underModuleslower_with_under_lower_with_underClassesCapWords_CapWordsExceptionsCapWordsFunctionslower_with_under()_lower_with_under()Global/Class ConstantsCAPS_WITH_UNDER_CAPS_WITH_UNDERGlobal/Class Variableslower_with_under_lower_with_underInstance Variableslower_with_under_lower_with_under(protected)Method Nameslower_with_under()_lower_with_under()(protected)Function/Method Parameterslower_with_underLocal Variableslower_with_underFor better readability, use meaningful, expressive names instead of hard-to-understand short names. Don’t drop letters from your source code. Although dropped letters in names likememcpy(memory copy) andstrcmp(string compare) were popular in the C programming language before the 1990s, they’re an unreadable style of naming that you shouldn’t use today. If a name isn’t easily pronounceable, it isn’t easily understood.Additionally, feel free to use short phrases that can make your code read like plain English. For example,number_of_trialsis more readable than simplynumber_trials.More on naming.Use a spell checker.Code StructureThe maximum line length is 120 characters.Whitespaces should be automatically deleted; the autoformatter should take care of this.Improve readability by limiting the number of nested statements.Preferrably write short functions, andpure functionsthat can be tested.