text:
Changelog
=========

v0.9.2
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.9.1...v0.9.2)

Improvements
- Improves robustness and speed of ``map_coordinates``.
- Adds axis parameters ``Ra_n`` and ``Za_n`` as optimizable DoF when using standard
constrained optimization methods (ie, not ``ProximalProjection``).
- Adds method to convert ``FourierRZCurve`` to ``FourierXYZCurve``.
- Makes DESC classes compatible with JAX pytrees.
- Adds Chebyshev polynomials as basis function (for future use).

Breaking changes
- Renames ``theta_sfl`` to ``theta_PEST`` in compute functions to avoid confusion with
other straight field line coordinate systems.
- Makes plotting kwargs a bit more uniform. ``zeta``, ``nzeta``, ``nphi`` have all been
superceded by ``phi`` which can be an integer for equally spaced angles or a float or
array of float to specify angles manually.

Bug fixes
- Avoids accidentally overwriting equilibria during automatic continuation method.

New Contributors

- \@rahulgaur104 made their first contribution in https://github.com/PlasmaControl/DESC/pull/576

v0.9.1
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.9.0...v0.9.1)

Deprecations
- Creating an ``Objective`` without specifying the ``Equilibrium`` or other object to be
 optimized is deprecated, and in the future will raise an error.
 - Passing in an ``Equilibrium`` when creating an ``Objective`` no longer builds the
 objective immediately.
 - ``Objective.build`` can now be called without arguments, assuming the object to be
 optimized was specified when the objective was created.
- Removes ``Equilibrium.solved`` attribute as it was generally unused and occasionally
caused issues when saving to VMEC format.

New Features
- Adds ``deriv_mode="looped"`` option to ``desc.objectives.ObjectiveFunction`` for
computing derivative matrices. This is slightly slower but much more memory efficient
than the default ``"batched"`` option.
- Adds BFGS option for augmented Lagrangian optimizers.
- Adds utility functions for computing line integrals, vector valued integrals, and
integral transforms in ``desc.compute.utils``.
- Adds ``method="monotonic-0"`` to ``desc.interpolate.interp1d``, which enforces
monotonicity and zero slope at the endpoints.
- Adds ``rho`` argument to ``desc.plotting.plot_boozer_surface`` to specify the desired
surface, rather than having to create custom grids. Also adds a ``fieldlines`` argument
for overlaying magnetic field lines on the Boozer strength plot.
- DESC objects with a ``change_resolution`` method now allow changing symmetry type.

Minor Changes
- Augmented Lagrangian methods now use a default starting Lagrange multiplier of 0, rather
than the least squares estimate which can be a bad approximation if the starting point
is far from optimal. The old behavior can be recovered by passing
``"initial_multipliers": "least_squares"`` as part of ``options`` when calling ``optimize``.
- Enforces periodicity convention for ``alpha`` and ``theta_sfl`` - They are both now
defined to be between 0 and 2pi.

Bug Fixes
- Flips sign of current loading/saving VMEC data to account for negative Jacobian.
- Increases default resolution for computing magnetic field harmonics in ``desc.plotting.plot_qs_error``
to avoid aliasing.
- Ensures that ``Basis.L`` , ``Basis.M``, ``Basis.N`` are all integers.
- Removes duplicated entries in the ``data_index``
- Fixes a bug in the normalization of the radial unit vector.

v0.9.0
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.8.2...v0.9.0)

New Features
- Implements a new limit API to correctly evaluate a number of quantities at the
coordinate singularity at $\rho=0$ rather than returning NaN. Currently only quantities
related to rotational transform and magnetic field strength are implemented, though in
the future all quantities should evaluate correctly at the magnetic axis. Note that
evaluating quantities at the axis generally requires higher order derivatives and so
can be much more expensive than evaluating at nonsingular points, so during optimization
it is not recommended to include a grid point at the axis. Generally a small finite value
such as ``rho = 1e-6`` will avoid the singuarlity with a negligible loss in accuracy for
analytic quantities.
- Adds new optimizers ``fmin-auglag`` and ``lsq-auglag`` for performing constrained
optimization using the augmented Lagrangian method. These generally perform much better
than constrained algorithms from scipy.
- Adds interfaces to ``trust-constr`` and ``SLSQP`` methods of ``scipy.optimize.minimize``.
These methods can handle general nonlinear constraints, though their performance on
badly scaled problems like those encountered in stellarator optimization isn't great.
- Adds calculation of the PEST straight field line coordinate jacobian, which is now
used to check for nestedness in ``Equilibrium.is_nested``. Previously the non-straight
field line jacobian was used, which would not detect if SFL theta contours overlapped.
- Introduces a new function/method ``Equilibrium.map_coordinates`` which generalizes
the existing methods ``compute_theta_coordinates`` and ``compute_flux_coordinates``,
but allows mapping between arbitrary coordinates.
- Adds calculation of $\nabla \mathbf{B}$ tensor and corresponding $L_{\nabla B}$ metric
- Adds objective ``BScaleLength`` for penalizing strong magnetic field curvature.
- Adds objective ``ObjectiveFromUser`` for wrapping an arbitary user defined function.
- Adds utilities ``desc.grid.find_least_rational_surfaces`` and
``desc.grid.find_most_rational_surfaces`` for finding the least/most rational surfaces
for a given rotational transform profile.

Breaking changes
- ``Objective`` and ``ObjectiveFunction`` compute methods have now been separated into
``compute_unscaled`` which returns the raw physics value of the objective,
``compute_scaled``, which returns the normalized value, and ``compute_scaled_error``
which returns the normalized difference between the physics value and the target/bounds.
Similarly, ``jac_scaled`` and ``jac_unscaled`` are the relevant derivatives (note that
``jac_scaled`` is equivalent to ``jac_scaled_error`` as the constant target drops out).
``grad`` and ``hess`` methods still correspond to ``compute_scalar`` which returns the
 sum of squares of ``compute_scaled_error``
- renames ``zeta`` -> ``phi`` in many places in ``desc.plotting`` to be consistent with
when we mean the computational coordinate $\zeta$ vs the physical coordinate $\phi$
- Replaces ``nfev`` with ``maxiter`` in many places in the code. For most optimizers
in scipy and all DESC optimizers, one iteration means one accepted step, which may
require more than 1 function evaluation due to line searches or trust region subproblems.
However, derivatives are generally only evaluated once per iteration, and are usually the
most significant cost, so the iteration count is generally a better proxy for wall time
than number of function evaluations.

Minor changes
- Minor updates to work with newer versions of JAX. Minimum ``jax`` version  is now
``0.3.2``, as some functions used in the constrained optimizers aren't present in
previous versions. Maximum ``jax`` version is now ``0.4.11``, the latest as of 6/13/23.
- Adds new ``ObjectiveFunction`` attributes ``target_scaled`` and ``bounds_scaled``
which return vectors of the scaled values from each sub-objective.
- Adds automatic scaling of variables for ``scipy.optimize.minimize`` methods, using
the hessian at the initial point.
- Ensures objectives don't have both bounds and target set at the same time. This
occasionally caused issues if one of them had a default value without the user realizing.
- Adds documentation on how to interface with new optimizers.
- Adds a documentation notebook with a simple example of using constrained optimizers
- Adds a table of optimizer info to docs
- Adds capability of ``InputReader`` to read VMEC files that have inputs spanning
multiple lines
- Reduces default initial trust region radius for most optimizers to be more conservative.
- Adds a "softmin" option to ``PlasmaVesselDistance`` objective which is smoother and
usually provides a better optimization landscape compared to the standard hard min.

Bug Fixes
- Fixes orientation of theta in VMEC output. (Previously we flipped theta for the base
quantities such as $R$, $Z$, and $\lambda$, but not derived quantities such as $B$ and $J$).
- Fixes VMEC utility bug that would cause ``xn``, ``xm`` to be empty if the Fourier
modes given had only sine symmetry.
- Fixes bug when VMEC input file has duplicated lines, DESC now will just use the
last duplicated line (which is what VMEC does)

New Contributors

- \@pkim1818 made their first contribution in https://github.com/PlasmaControl/DESC/pull/503

v0.8.2
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.8.1...v0.8.2)

New Features
- New compute functions for derivatives of contravariant metric tensor elements, eg, for Laplace's equation.
- New objective `Isodynamic` for penalizing *local* radial drifts, not just the bounce average as in QI
- `solve_continuation_automatic` now uses adaptive step sizing for perturbations in the event of a solution becoming unnested.

Minor changes
- Now uses `jnp` for perturbations rather than `np` which should be significantly faster, especially on GPU
- The `fixed_boundary` flag has been removed from `FixBoundaryR` and `FixBoundaryZ` constraints. It is now detected automatically based on the objective and optimizer.
- Plotting normalized force error now always uses the gradient of magnetic pressure to normalize, even at finite beta. The old behavior can be recovered by passing `norm_name="<|grad(p)|>_vol"` to the relevant plotting function.

Bug Fixes
- Fixed minor bug with symmetric grids that caused end points to be double counted
- Fixed bug causing `NFP` of curves to not be updated correctly when the equilibrium changed
- Fixed issue when converting `pyQIC` solutions to `DESC` equilibria related to offset toroidal grid

v0.8.1
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.8.0...v0.8.1)

Minor Changes
* Include near-axis verification checks in NAE-constrained equilibrium example notebook

Bug Fixes
* Fix read-the-docs build error
* Add missing classes to API docs
* fix error in fix axis util function
* Add missing attributes to new classes added in `v0.8.0`

v0.8.0
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.7.2...v0.8.0)

New Features
- Add profiles for kinetic quantities to `Equilibrium`
- Add compute functions and objectives for the bootstrap current for stellarators near quasisymmetry.
- Added ability to solve equilibria with the axis held fixed, or by constraining the O(rho) behavior from a near axis expansion.
- New objective for penalizing plasma-vessel distance
- All objectives now have a `bounds` argument, and the loss will be zero if within bounds.
- Added compute functions for field line quantities such as field line label `alpha`, unit vector `b`, field line curvature `kappa` etc.
- Add compute functions for covariant components of current.
- `Equilibrium.compute` will now automatically use the correct grids for surface and volume averages.
- Added a number of fields to VMEC output from DESC equilibria.

Minor Changes
- Improved handling of indefinite hessian matrices in `fmintr`

Bug Fixes
- Fix issue with composite profiles parsing parameters incorrectly
- Loading an equilibrium from VMEC now uses spline profiles to ensure consistency, as VMEC does not always save the input profile

v0.7.2
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.7.1...v0.7.2)

What's Changed
* Fix bug in QS Boozer metric where non-symmetric modes were sometimes counted as
symmetric due to different Fourier series conventions.
* Improve speed of functions for converting between VMEC and DESC Fourier representations.
* Add objectives for penalizing strong shaping.
    - `MeanCurvature` targets values for the mean curvature of the flux surfaces
    (average of principal curvatures)
    - `PrincipalCurvature` penalizes the largest magnitude of the principal curvatures
* Improve default tolerances when converting input file from VMEC to DESC

v0.7.1
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.7.0...v0.7.1)

What's Changed
- Allow targets for `RotationalTransform` and `ToroidalCurrent` objectives to be Profile
  objects rather than just arrays.
- Document how to add new compute functions and objectives.
- Add objective for targeting elongation.
- Fix bug in `plot_qs_error` causing the same value to be plotted for each value of rho.
- Fix bug sometimes causing the wrong equilibrium to be returned after optimization.
- Improve numerical stability of perturbations and optimization.

v0.7.0
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.6.4...v0.7.0)

New Features
- Add implementation of `Surface.compute_curvature`.
- Add `return_data` flag to plotting functions to return dictionary of plotted data.
- Add computation of beta, average B, surface curvature, magnetic field derivatives, and others.
  Full list at https://desc-docs.readthedocs.io/en/stable/variables.html
- Modify `Surface` classes to always orient surfaces correctly to give the equilibrium a positive Jacobian. This means DESC will always use a right handed coordinate system in both cylindrical and flux coordinates. Previously the orientation of the flux coordinate system would depend on the boundary parameterization.
- New utility function `desc.compat.ensure_positive_jacobian` for converting previously saved equilibria to a right handed coordinate system.

Major Changes
- Refactored backend `compute` functions to calculate dependencies recursively. This should make it much easier to add new quantities, and reduces compilation times by 50-70%

Minor Changes
- Refactor wrapping of scipy optimizers.
- Add check for incompatible constraints in optimization.
- Improvements to `plot_1d` to correctly plot flux surface average quantities.
- Speed up calculation of Boozer transform.
- Have stability objectives print their max, min and average value at end of solve.

Bug Fixes
- Fix issue where if fixing specific boundary modes, the indices used to index the target do not match up with the indices of the A matrix.
- Fix weighting of duplicate nodes for periodic domains.
- Ensure transforms build correctly even with empty grid.
- Ensure transforms always have 0,0,0 derivative.
- Change normalization for poloidal field to avoid having a 0 normalization factor.

v0.6.4
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.6.3...v0.6.4)

Major Changes
- All objectives now have a `normalize` argument that when true will nondimensionalize
the physics value and scale to be approximately ~O(1) in magnitude. This should make it
easier to tune weights when doing multiobjective optimization.
- New objective `RotationalTransform` for targeting a particular iota profile in real
space.
- New function `plot_boundaries` to plot comparisons between boundary shapes.

Minor Changes
- Maximum JAX version is now `0.4.1` (latest version as of release date). Minimum
version is still `0.2.11` but this will likely change in the future.

Bug fixes
- Fix indexing bug in biot-savart for coils that caused the output to have the wrong shape
- Fix a bug occasionally preventing the optimizer from restarting correctly after
trying a bad step

v0.6.3
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.6.2...v0.6.3)

Major Changes
- Adds new function ``desc.continuation.solve_continuation`` which is a functional interface to the ``EquilibriaFamily.solve_continuation`` method
- Adds new function ``desc.continuation.solve_continuation_automatic`` which uses conservative default settings in a continuation method for solving complicated equilibria.
- Adds method ``Objective.xs(eq)`` for getting needed arguments for an objective. For example, ``objective.compute(*objective.xs(eq))``.
- Adds utility ``desc.perturbations.get_deltas`` for finding the differences between surfaces and profiles for perturbations.

Minor Changes
- ``EquilibriaFamily`` can now be created with one or more ``Equilibrium`` objects, or no arguments to create an empty family
- ``SplineMagneticField`` can now interpolate axisymmetric fields more efficiently.

Bug Fixes
- Fix bug preventing ``lsqtr`` from terminating when ``maxiter`` is zero.
- Fix bug when converting profiles to ``FourierZernikeProfile``.
- Fix bug where a ``FixBoundary`` constraint with only 1 mode constrained would throw an error during ``objective.build``

v0.6.2
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.6.1...v0.6.2)

Minor Changes:
- Remove ``parent`` and ``children`` from ``Equilibrium`` - this was generally unused and caused memory leaks in long optimization runs.
- Allow targeting current on multiple surfaces with ``ToroidalCurrent`` objective.
- Refactored optimizer backends to get rid of unused code and use more standard BFGS implementation.
- Added ``sgd`` optimizer for performing fixed step gradient descent, with or without momentum. In the future this will be upgraded to include other step size rules and line searches.
- Allow selecting profile when loading VMEC equilibrium, as previously fixed iota was always assumed.
- Ensure equilibrium and surface have same symmetry.

Bug fixes:
- Fix floating point comparison when recovering solution after optimization, occasionally leading to the wrong iteration being returned as "optimal"
- Fix plotting iota of a current-constrained with ``plot_1d`` function
- Fix bug where having iota specified in an input file along with vacuum objective lead to error. Now specifying vacuum objective will ignore all profile inputs

v0.6.1
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.6.0...v0.6.1)

New Features
- `plot_boundary` function to plot boundary surfaces and multiple toroidal angles together in a single plot. This is a popular plot format in stellarator optimization papers when comparing boundary shapes.

Bug Fixes
- Fix bugs for vacuum solve
  - Allow for constraining arguments that aren't used in the objective (i.e pressure when minimizing current density)
  - fix bug in `CurrentDensity` where only jacobi grid was being used
- Fixes to wrapped objective and jit compiling
  - optimizer with wrapped objective would sometimes return the equilibrium after the final attempted step, even if that step was rejected for not lowering the objective, resulting in incorrect "optimal" result
  - Fixes a bug where the `use_jit` arg passed to `objective.build` would override any previously set value for `use_jit` (such as in the class constructor)
- Grid spacing bugs fixed
  - fixed a bug where setting nodes with a linear spaced array versus asking for `N` linearly spaced nodes would result in different weights despite being the same nodes

v0.6.0
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.5.2...v0.6.0)

Major changes

-   Can now solve equilibria with fixed toroidal current, as opposed to
    fixed rotational transform.
    -   input file now accepts `c` parameter for toroidal current
        profile (in Amps - note it should be an even polynomial and 0 on
        axis)
    -   `Equilibrium` now has attribute `current` which can be set to
        any `Profile` type (or `None` if using rotational transform)
    -   Default `Equilibrium` is now fixed zero current rather than zero
        rotational transform.
    -   For equilibria with both `iota` and `current` assigned, which to
        fix should be specified manually by using either `FixIota` or
        `FixCurrent` constraints
    -   Note that computing `iota` from fixed current requires flux
        surface averages, so more oversampling in real space may be
        required to get correct values.
-   Near axis interface:
    -   `Equilibrium.from_near_axis` allows users to load in a solution
        from `pyQSC` or `pyQIC`.
    -   `FourierRZToroidalSurface.from_near_axis` allows users to create
        boundary surfaces that are approximately QP/QI based on an
        unpublished analytic model shared by Matt Landreman.

Minor changes

-   Plotting:
    -   Document kwargs, according to [matplotlib-style
        documentation](https://stackoverflow.com/questions/62511086/how-to-document-kwargs-according-to-numpy-style-docstring)
    -   Add kwargs to plotting functions missing sensible/useful kwargs
    -   Add check for unused kwargs to most plotting functions
    -   Add `norm_F` option to `plot_fsa`
-   Transform:
    -   Modifies `Transform.fit` to use the inverse of the forward
        method transform method (ie, `direct1`, `direct2`, `fft`) rather
        than always the full matrix inverse as in `direct1`
    -   Removes weighting from `transform.fit`, to ensure that the
        inverse transform is the actual inverse of the forward
        transform.
-   Profiles:
    -   Add methods and classes for adding, subtracting, multiplying,
        scaling profiles
    -   Add class for anisotropic profiles using Fourier-Zernike basis
        (though the compute functions don\'t make use of the anisotropy
        yet)
-   Input/Output:
    -   VMEC input conversion now allows for:
        -   comma-separated lists of numbers, such as:
            `AC = 1.0, 0.5, 0.2`
        -   non-stellarator symmetric axis initial guesses using the
            inputs `RAXIS_CS` and `ZAXIS_CC`
    -   Add the Boozer currents `I` and `G` and the Mercier stability
        fields to VMEC outputs.
    -   Make DESC input file reader agnostic to the case of the input
        options (i.e. `spectral_indexing=ANSI` in the input file will
        work now and register as `ansi` internally)
-   Misc:
    -   Allow applying boundary conditions on interior surfaces: Adds a
        `surface_label` arg to `FixBoundaryR` and `FixBoundaryZ`,
        defaulting to the label of the given surface. That surface is
        fixed, instead of always the rho=1 surface.
    -   Remove `use_jit` from `Derivative` class in favor of `jit`ing
        attributes of `ObjectiveFunction`
    -   Add `jit` to `ObjectiveFunction.jvp`, to hopefully speed up
        perturbations a bit
    -   Enforce odd number of theta nodes for `ConcentricGrid`, to
        ensure correct flux surface averages
    -   Remove `ConcentricGrid` `rotation` option, as this was generally
        unused and caused some issues with surface averages.

Bug fixes

-   Fix bug in derivative of abs(`sqrt(g)`) (thanks to Matt Landreman
    for reporting). Affected quantities are `V_rr(r)`, `D_well`,
    `D_Mercier`, `magnetic well`
-   Fix a bug with using `Transform.fit()` for double Fourier series on
    multiple surfaces simultaneously. Performing the fit one surface at
    a time corrects this, but there could be room for speed
    improvements.
-   Rescale the Jacobian saved as `gmnc` & `gmns` when saving a VMEC
    output to reflect the VMEC radial coordinate convention of
    `s = rho^2`.

v0.5.2
------

[Github Commits](https://github.com/PlasmaControl/DESC/compare/v0.5.1...v0.5.2)

Major Changes

-   New objectives for `MercierStability` and `MagneticWell`
-   Change `LinearGrid` API to be more consistent with other `Grid`
    classes:
    -   L, M, N now correspond to the grid spectral resolution, rather
        than the number of grid points
    -   rho, theta, zeta can be passed as integers to specify the number
        of grid points (functionality that used to belong to L, M, N)
    -   rho, theta, zeta still retain their functionality of specifying
        coordinate values if they are not integers
    -   Other code that depends on `LinearGrid` was updated accordingly
        to use the new syntax
-   Poloidal grid points are now shifted when `sym=True` to give correct
    averages over a flux surface.
-   Added default continuation steps to converted VMEC input files

Minor Changes

-   add option to `plot_comparison` and `plot_surfaces` to not plot
    vartheta contours
-   Add better warnings for gpu and jax issues
-   add volume avg force and pressure gradient to the compute functions
-   change `is_nested` function to use jacobian sign instead of looking
    for intersections between surfaces
-   Allow alternate computation of multi-objective derivatives,
    computing individual jacobians and blocking together rather than
    computing all at once.

Bug Fixes

-   Fix nfev=1 and Some scalar solver Issues
-   Fix some formula errors in second derivatives of certain magnetic
    field components, caused by some hanging expressions.
-   fix bug where node pattern is always jacobi when force is used as
    objective
-   Allow hdf5 to store None attributes correctly
-   Fix profile parity and Z axis coefficients in `VMECIO.save`
-   Ensure axis coefficients are updated correctly after solving
    equilibrium

New Contributors

-   \@unalmis made their first contribution in
    <https://github.com/PlasmaControl/DESC/pull/247>

v0.5.1
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.5.0...v0.5.1)

Major Changes

-   Add ability to change NFP after creation for equilibria, curves, and
    surfaces.
-   Fix rounding errors when building high resolution grids.
-   Rename `LambdaGauge` constraint to `FixLambdaGauge` for consistency.
-   Documentation updates to hdf5 output, VMEC conversion, plotting,
    etc.
-   Change default spectral indexing to \"ansi\".
-   Adds `desc.examples.get` to load boundaries, profiles, and full
    solutions from a number of example equilibria.
-   Default grid resolution is now 2x spectral resolution.
-   New surface method `FourierRZToroidalSurface.from_input_file` to
    create a surface from boundary coefficients in a DESC or VMEC input
    file.
-   Adds new tutorial notebooks demonstrating VMEC io, continuation,
    plotting, perturbations, optimization etc.
-   New documentation on perturbation theory and evaluating Zernike
    polynomials.
-   Fix bug preventing vacuum solutions from solving properly.

v0.5.0
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.12...v0.5.0)

Major Changes

-   New API for building objectives and solving/optimizing equilibria. A
    brief explainer can be found in the
    [documentation](https://desc-docs.readthedocs.io/en/stable/notebooks/hands_on.html)
-   The Equilibrium class no longer \"owns\" an optimizer or objective,
    and does not build its own transforms.
-   The ObjectiveFunction class is a \"super-objective\" that combines
    multiple \"sub-objectives\" which follow the ABC \_Objective class.
-   Each sub-objective function can be used as either an \"objective\"
    (minimized during optimization) or a \"constraint\" (enforced
    exactly).
-   Each sub-objective function takes unique inputs that can be
    specified by a grid/surface/etc. or use default values from an
    Equilibrium.
-   Each sub-objective is responsible for building its own transforms or
    other constant matrices, and is also responsible for computing its
    own derivatives.
-   The super-objective dynamically builds the state vector with the
    independent variables from each sub-objective, and also combines the
    function values and derivatives by combining the outputs from each
    sub-objective.
-   The super-objective only takes a single argument (the state vector x
    or y). Perturbations are now performed wrt the full state vector y,
    which contains all of the individual parameters.
-   Adds ability to optimize physics quantities under equilibrium
    constraint using wide array of scipy and custom optimizers.
-   New objective for solving vacuum equilibria

v0.4.13
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.12...v0.4.13)

Major Changes

-   Updates JAX dependencies to take advantage of new functionality and
    faster compile times:
-   Minimum `jax` version is now 0.2.11
-   Minimum `jaxlib` version is now 0.1.69
-   Pressure and Iota perturbations now weight mode numbers by
    `L**2 + M**2` to avoid high frequency noise.
-   Custom weighting also allowed by passing `weights` array to
    `perturb` functions
-   Refactor `basis.get_idx` to use a lookup table rather than
    `np.where`. This means it works under JIT and AD, but only allows
    scalar inputs. To get multiple indices, call the method multiple
    times
-   `ConcentricGrid` now accepts a rotation argument to rotate the grid
    for either `'sin'` or `'cos'` symmetry, or `False` for no symmetry.
    This is independent of the `sym` argument, which eliminates nodes
    with theta \> pi.
-   Derivative operators for spline based profile and magnetic field
    classes are now precomputed, giving roughly 30-40% speedup in
    evaluation.

Bug Fixes

-   Fixed a bug where some properties were not copied correctly when
    doing `obj.copy(deepcopy=True)`
-   Fixed sign convention on poloidal quantities when saving to VMEC
    format
-   Fixed bugs in `Curve` and `Surface` that would fail when setting
    coefficients in JAX arrays

Testing

-   Add tests for Heliotron example
-   Adds timing benchmarks for standard equilibrium solves

Examples

-   Fix sign convention issue with Heliotron boundary modes to be
    consistent with VMEC
-   Add example for Simsopt QA stellarator from A. Bader et al. 2021

Miscellaneous

-   renamed `opsindex` to `Index` for consistency with JAX
-   Move `sign` function from `utils` to `backend`, as it now needs JAX
-   lots of minor formatting changes in docstrings

v0.4.12
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.11...v0.4.12)

New Features:

-   New function `plot_comparison` to plot comparison between multiple
    DESC equilibria
-   `plot_surfaces` now has a more intuitive API - instead of specifying
    grids, the user specifies the specific rho/theta contours to plot
-   `equil.is_nested` now checks more toroidal planes for
    non-axisymmetric equilibria by default
-   Updates `Equilibrium` to make creating them more straightforward.
    -   Instead of a dictionary of arrays and values, init method now
        takes individual arguments. These can either be objects of the
        correct type (ie `Surface` objects for boundary condiitons,
        `Profile` for pressure and iota etc,) or ndarrays which will get
        parsed into objects of the correct type (for backwards
        compatibility)
    -   Also introduces more options for generating initial guesses, and
        a new dedicated method `equilibrium.set_initial_guess()`. The
        default is to scale the boundary surface that is assigned to the
        equilibrium, but another surface (and axis) can be supplied as
        an argument to the function to use that surface instead for the
        initial guess. It also accepts another `Equilibrium` instance,
        or a path to a saved DESC or VMEC equilibrium which will be
        loaded and its flux surfaces will be used as the initial guess.
    -   Command line interface updated to allow for initial guesses from
        DESC or VMEC solutions using `--guess=path` (this also replaces
        the old `--vmec` flag)
-   Adds classes for representing various types of magnetic fields
    -   Base class for all magnetic field types defining the
        `compute_magnetic_field` API and methods for combining fields
    -   `SplineMagneticField` for dealing with mgrid files and splining
        expensive to compute fields
    -   `ScalarPotentialField` for vacuum fields that can be written as
        B=grad(Phi)
    -   basic field types for testing, such as toroidal, poloidal,
        vertical
    -   field line integration function for tracing field lines in
        R,phi,Z, using JAX for differentiability

v0.4.11
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.10...v0.4.11)

Bug fixes:

-   Transforms used in the profile class weren\'t built by default,
    causing them to be built when first called which is under jit,
    meaning they would be recomputed every time instead of caching the
    transform as expected. Updated to now build transforms by default.

New Features:

-   DESC version number is now saved in hdf5 output files as
    `__version__` field.
-   Added straight field line method for plotting field line traces from
    a solved equilibrium.
-   A new method has been implemented that uses identities for the
    zernike polynomials in terms of jacobi polynomials, and a stable
    iterative evaluation for the jacobi polynomials and binomial
    coefficients. Accuracy seems on par or better than the old method
    using extended precision, at least for a given amount of computation
    time. There is some overhead from JIT compilation, but seems to pay
    off well for high resolution
-   Added new \"unique\" option for `basis.evaluate` to first reduce the
    work by finding unique combos of nodes/modes. Previously this was
    done inside each basis function evaluation, but doing it on the
    outside should be more efficient and makes the underlying functions
    differentiable.
-   Refactored fourier series evaluation to shift the arguments for
    evaluating derivatives rather than using recursion and conditionals.

v0.4.10
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.9...v0.4.10)

Bug Fixes:

-   Reordered import statements to ensure user requests to use GPU are
    handled correctly

New Features:

-   Adds several new classes to represent different
    types/parameterizations of curves and surfaces, for plasma
    boundaries, coordinate surfaces, coils, magnetic axis etc
-   New classes also have several new methods that will be made into
    objectives in the future, such as area, length, curvature, etc.
-   Surfaces can be used as boundary conditions via
    surface.get\_constraint method
-   Added new plot method to trace field lines and plot them in real
    space (R, phi, Z)

v0.4.9
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.8...v0.4.9)

Bug Fixes:

-   Fix a major bug in the least squares routine that set the initial
    regularization parameter to np.nan, meaning that the optimizer would
    stall as soon as it can no longer take full newton steps.

New Features:

-   Adds a Cholesky factorization option for solving the least squares
    trust region problem. This can be faster, but less numerically
    stable due to squaring the condition number of the Jacobian. Often
    still produces good results since the trust region itself
    regularizes the solution enough to overcome the poor conditioning.
-   Methods that take Grid objects now also accept an ndarray of nodes
    or an integer specifying the number of nodes in each direction.
-   Added repr methods for string representations of more objects.

v0.4.8
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.7...v0.4.8)

Bug fixes:

-   Fixed array comparison in `eq` method to return `False` for
    differently sized arrays rather than throwing an error
-   Misc errors fixed in `VMECIO.save()`
-   Fixed indexing issue with m=0, n=0 modes when transforming
    `FourierSeries` basis
-   Fixed sign error in computations of MHD energy

Changes:

-   2nd-order optimal perturbation capability added
-   Quasi-symmetry objective functions have been validated against
    STELLOPT benchmarks
-   Additional data added to the VMEC-like NetCDF output generated by
    `VMECIO.save()` for compatibility with other legacy codes
-   Added equilibrium methods for calculating cross sectional area,
    aspect ratio, major and minor radii
-   Grid weights are now scaled to always sum to 4pi\^2 even for
    symmetric grids so that volume and area will be calculated correctly
    for symmetric equilibria

Tests:

-   Added tests for `VMECIO.save()`
-   Added tests for `FourierSeries` transform bug

v0.4.7
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.6...v0.4.7)

Bug fixes:

-   Fixes the magnetic axis initial guess error raised in Issue \#92

Tests:

-   Added a test to check the magnetic axis guess is used properly
-   Updated the \"Dummy Stellarator\" parameters, which gets used for
    several of the tests

v0.4.6
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.5...v0.4.6)

Bug fixes:

-   Plots of straight field line vartheta contours are now actually of
    straight field line vartheta, previously they were only
    approximations.

Backend:

-   New method `equil.compute_theta_coords` finds the geometric angle
    theta that maps to a given straight field line angle vartheta

v0.4.5
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.4...v0.4.5)

Bug fixes:

-   Fix bug in pickle IO that prevented objects with jitted attributes
    from being saved, pickling now only saves essential information.

Changes:

-   Added generic load function for loading objects without knowing what
    class they are
-   Removed usage of \"==\" operator between DESC objects in favor of
    `obj1.eq(obj2)`. Equivalence is defined as \"if saved and loaded,
    the two objects would be the same,\" so it ignores equality in
    trivially recomputeable attributes and focuses on the actual physics
    of the objects being compared.
-   Concentric grids are now up-down symmetric when symmetry is not
    enforced

Backend:

-   Remove `object_lib` from io, instead, now use built in dynamic
    importing to import the correct classes at runtime
-   Avoids needing to import classes in lots of files just so they can
    be in the `object_lib`, makes adding new stuff a lot easier.
-   Changed name in io stuff to class to avoid conflicts with actual
    name attributes

v0.4.4
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.3...v0.4.4)

Bug Fixes:

-   Fixed key error in hdf5io that prevented some solutions from being
    loaded properly
-   Updated requirements with correct version of flatbuffers to work
    with JAX

Documentation:

-   Updated installation instructions
-   Updated hands on example and other notebooks with recent changes
-   Fixed bug where docs wouldn\'t build on RTD

New functionality:

-   Added new method equilibrium.compute\_flux\_coords to find the flux
    coordinates (rho, theta, zeta) corresponding to a set of real space
    coordinates (R,phi,Z), useful for computing synthetic diagnostics.

Backend:

-   Added wrappers for more control flow operators, which will be needed
    for future development
-   Added interpolation module with 1d, 2d, and 3d interpolation using
    linear or various cubic splines. These will primarily be needed for
    planned work on equilibrium reconstruction.

v0.4.3
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.2...v0.4.3)

Major changes:

-   New transform method `direct2` that uses DFT instead of FFT to
    handle general toroidal spacing and number of planes
-   Plotting now quite a bit faster due to not having to oversample or
    use direct1 method
-   Removed `zeta_ratio` as it generally didn\'t give good results and
    is quite a bit slower than standard boundary perturbations
-   Zernike evaluation now done with higher precision for L\>24
-   Updated ASCII output format
-   Refactored how jacobian is calculated to hopefully use less memory
    on GPUs
-   New abbreviated syntax for continuation parameter arrays (see docs
    for more details)

v0.4.2
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.1...v0.4.2)

Major changes:

-   New concentric grid pattern [ocs]{.title-ref}, designed to reduce
    the condition number of the interpolation matrix for fitting data to
    a zernike basis.
-   Fixed bug in poloidal resolution for concentric grids with \"ansi\"
    indexing, where only M+1 points were used instead of the correct
    2\*M+1
-   Rotated concentric grids by 2pi/3M to avoid symmetry plane at
    theta=0,pi. Previously, for stellarator symmetic cases, the nodes at
    theta=0 did not contribute to helical force balance.
-   Added [L\_grid]{.title-ref} parameter to specify radial resolution
    of grid nodes directly and making the API more consistent.

v0.4.1
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.4.0...v0.4.1)

Major Changes:

-   GPU allocation should work correctly now, previously JAX would grab
    all GPU memory even if told to only run on CPU
-   Updated I/O to work with h5py version 3, no longer support h5py
    version 2

v0.4.0
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.28...v0.4.0)

v0.3.28
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.27...v0.3.28)

Major changes:

-   better normalization for QS\_TP

v0.3.27
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.26...v0.3.27)

Major changes:

-   Update equilibriafamily to reuse objectives if possible

v0.3.26
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.25...v0.3.26)

Major changes:

-   Quasisymmetry metric finished and checked
    -   Quasisymmetry compute function is finished. This computes the
        triple product metric of quasisymmetry, denoted \'QS\_TP\'.
    -   The flux function metric \'QS\_FF\' is also computed, but has
        singularities.
    -   Appropriate references to quasisymmetry are added to
        Configuration and the plotting routines.
    -   Extensive testing functions were added to verify that the
        magnetic field and magnitude components agree with finite
        difference calculations.
    -   A \"dummy stellarator\" example was added to the test suite.
        This configuration is not in equilibrium, and gets used to test
        the compute functions.

v0.3.25
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.24...v0.3.25)

Major changes:

-   Add 3rd order perturbations
    -   seems like they\'re not that great, error is usually worse than
        2nd order but a bit better than 1st.
    -   also they take a long time (4x longer than 2nd order)
    -   might still be useful

v0.3.24
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.23...v0.3.24)

Major changes:

-   Add method to convert between coordinates
    -   Going from sfl -\> boundary representation is trivial because
        the sfl coords are valid bdry coords
    -   Going the other way is hard
    -   Added a method to configuration to transform to sfl by least
        squares fitting the flux surfaces using lambda shift
    -   Surfaces look ok after transforming, but error is a bit high
        around the edges, so we might want to revisit it in the future
        to see if we can find a better way to do it (field line
        integration?)

v0.3.23
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.22...v0.3.23)

Major changes:

-   Update handling of gpu backend
    -   Previously, telling it to run on the gpu didn\'t actually work
        and most of the computation would still be done on the cpu
    -   refactored the old method to handle the gpu properly
    -   new function for setting device that should be called before
        importing anything from backend (or anything that imports
        backend)
    -   new packages required to parse gpu and cpu info, so make sure to
        update with [pip install -r requirements.txt]{.title-ref}

v0.3.22
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.21...v0.3.22)

Major changes:

-   Added an ABC BoundaryCondition class, which inherits from
    LinearEqualityConstraint. Concrete BC\'s such as LCFSConstraint and
    PoincareConstraint are children of BoundaryCondition.
-   Added ZernikePolynomial as a Basis type. This is used for Rb\_basis
    and Zb\_basis when bdry\_mode=\"poincare\".
-   Equilibrium now has a constraint property to represent the BC. This
    must be set before setting the equilibrium\'s objective.

Minor changes:

-   Updated tests to work with changes.
-   Changed definition of beta to be e\^theta-iota\*e\^zeta. This makes
    F\_rho and F\_beta have the same units (N/m\^2).
-   Default spectral indexing set to \"fringe\" (instead of \"ansi\") in
    Basis object constructors.
-   Renamed Rb\_mn and Zb\_mn to Rb\_lmn and Zb\_lmn to reflect more
    general usage.
-   Documentation updates to meet NumPy documentation style
    requirements.

v0.3.21
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.20...v0.3.21)

This update addresses 2 major issues: objectives/optimizers not being
saved, and objectives getting compiled more often than necessary

Major Changes:

-   Changes to Equilibium/EquilibriaFamily:
    -   general switching to using properties rather than direct
        attributes when referencing things (ie, `eq.foo`, not
        `eq._foo`). This allows getter methods to have safeguards if
        things weren\'t defined or loaded correctly for some reason
    -   Add `node_pattern` property to equilibrium
    -   Add public `transforms` property to equilibrium (public
        interface to old `_transforms` dict)
    -   When assigning objective function to equilibrium, it now checks
        if the new one is equivalent to the old one, if they are it
        skips the update. This prevents needless recompilation if
        nothing really changed.
    -   optimizer and objective attributes now assigned to
        `equilibrium.initial`
-   Changes to objective functions:
    -   object lib is now set correctly for saving/loading
    -   init method can now properly handle loading from file
    -   moved most of the derivative setup/jit/etc to its own method
        that is automatically called after the main init. The function
        `set_derivatives` can also be called manually to change jit
        settings or devices to compile to.
    -   compiling is now done on the objective rather than the
        optimizer, again, a way to prevent needless recompilation. This
        is done with a new `compile` method that takes the generic
        function arguments to call the objective, plus a \"mode\"
        argument to tell it which derivatives to compile (ie, for scalar
        vs least squares optimization)
    -   new `eq` method for comparing different objective functions.
        Effectively the same way we\'ve been doing a custom `__eq__`,
        but we can\'t do that for the objectives because it breaks the
        hashing the jax uses when jitting the objective. So instead of
        doing `objective1 == objective2`, do `objective1.eq(objective2)`
    -   Removed init methods from `ForceErrorNodes` and
        `ForceConstraintNodes`, since the default one from
        `ObjectiveFunction` now handles everything.
    -   Init for Galerkin and Energy remains but just calls super init
        and then warns if the grid is not quadrature grid
    -   new method to make sure the transforms have the correct
        derivatives for the objective and recomputing them if not
-   Changes to optimizer:
    -   io attributes now set, inheritance from IOAble and refactored
        init to work with io stuff
    -   objective no longer passed in at init, just the method
    -   instead, objective is now passed as an argument to
        `optimizer.optimize()`
    -   removed compile method in favor of compiling the objective
        directly (which is automatically done in optimizer.optimize)
    -   added equality checking for optimizers

v0.3.20
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.19...v0.3.20)

Major Changes:

-   added `ForceErrorGalerkin` objective function
    -   Returns the Galerkin equations (spectral coefficients of the
        residual), computed using Gaussian integration
    -   \"galerkin\" objective option in the input file
    -   Must use with `quad` node pattern

v0.3.19
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.18...v0.3.19)

Major Changes:

-   Added missing arg for scaling in equilibrium optimize/solve methods
-   Now checks for nestedness after perturbing but before solving to
    avoid needless computation if the perturbation throws you way off

v0.3.18
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.17...v0.3.18)

Major Changes:

-   added compute functions for magnetic pressure gradient and magnetic
    tension
-   added `norm_F` option to `plot_2d` and `plot_section`, which will
    normalize F by gradP or grad(B\^2/2mu0), depending on if the
    equilibrium is a pressure or vacuum equilibrium.

v0.3.17
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.16...v0.3.17)

Major Changes:

-   Update perturbations with trust region
    -   Method of perturbations implicitly assumes an asymptotic
        ordering of the terms in the series, but sometimes the 2nd order
        term would be much larger than the first order and the result
        would be super wrong.
    -   Perturbations are now done using a trust region approach, where
        the error is minimized subject to a bound on the step size, and
        the bound is inversely proportional to the order of the
        perturbation.
    -   trust region ratio can be varied, default of 0.1 seems ok.
    -   2nd order perturbations for BC seem to work fine now
    -   2nd order for pressure still works, though visually they look a
        bit worse despite the new method resulting in lower force error.

v0.3.16
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.15...v0.3.16)

Major Changes:

-   Updated \"put\" test to avoid deprecated usage

v0.3.15
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.14...v0.3.15)

Major Changes:

-   Update plotting
    -   removed `Plot` class in favor of individual functions (class
        wasn\'t really doing anything and just led to extra typing)
    -   Fixed bug that caused things to be plotted against the wrong
        axes (with fft node sorting things should be reshaped as (M,L,N)
        order=\'F\')
    -   `plot_surfaces` and `plot_section` now plot multiple sections
        for non-axisymmetric cases by default
    -   Made 3d plot show all field periods by default
    -   Fixed aspect ratio on 3d plots so that the axes are equal
    -   Changed method for section plotting from `tricontourf` to
        regular `contourf` so it can plot non-convex shapes correctly
    -   Added tests for 3d plotting and plotting vs different grids
    -   Updated baseline images for all tests

v0.3.14
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.13...v0.3.14)

Major Changes:

-   Fix bug with boundary perturbations
    -   Changing the resolution before perturbation was changing the BC
        coeffs as well, so the delta was zero
    -   Now only change the resolution.
    -   Also added some logic to avoid recomputing stuff when not needed

v0.3.13
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.12...v0.3.13)

v0.3.12
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.11...v0.3.12)

Major Changes:

-   Update configuration - make private
-   Configuration now inherits from ABC
-   Replaced references to configuration in other code with reference to
    Equilibrium

v0.3.11
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.10...v0.3.11)

Major Changes:

-   `perturb` function uses jvp and has 1st-order testing
    -   perturb method now uses jvp instead of full jacobians for
        1st-order perturbations
    -   test\_perturbations.py is updated to include testing for the new
        syntax with a linear test function
    -   added Equilibrium.perturb() and ObjectiveFunction.jvp() methods

Minor changes:

-   added zeta\_ratio getter method to Configuration
-   added compute method to Equilibrium
-   bug fix in ObjectiveFunction.derivative for int argnums
-   updated documentation

v0.3.10
-------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.9...v0.3.10)

Major Changes:

-   Add blocked derivative
    -   AutoDiffDerivative now takes keyword args to compute
        jacobian/hessian in smaller blocks to save memory
    -   Still need to find sensible defaults or come up with some way to
        automatically select block size based on hardware and memory

v0.3.9
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.8...v0.3.9)

Major Changes:

-   Improved testing of SOLOVEV results
    -   Changed SOLOVEV input file to use same resolution as VMEC
        results
    -   Added a test to check that SOLOVEV solution matches VMEC results
    -   Created temporary directory to store misc testing files
    -   Fixed IO bug in Configuration

v0.3.8
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.7...v0.3.8)

Major Changes:

-   Fix issue with jax and zero sized arrays
    -   Computing the pseudoinverse of a zero sized array caused jax to
        crash
    -   Now have a check to only compute pinv if array has data,
        otherwise its just zeros.
    -   Jax now seems to work fine in all cases with the new coordinates

v0.3.7
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.6...v0.3.7)

Major Changes:

-   Update setup.py and \_\_main\_\_.py with version info

v0.3.6
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.5...v0.3.6)

Major Changes:

-   Add colorama and termcolor to requirements.txt

v0.3.5
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.4...v0.3.5)

-   initial work on VMEC IO
-   Added VMECIO class to handle loading and saving to/from VMEC netCDF
    file formats.
-   Removed check for nested flux surfaces.
-   Minor documentation changes.

v0.3.4
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.3...v0.3.4)

Major Changes:

-   Update BC to work with perturbations
-   Objective functions now know about bc constraint and how to convert
    between full and reduced form of x
-   LinearEqualityConstraint class now exposes A,Ainv,Z etc for other
    uses, bypassing methods of the class when we want to differentiate
    through them

v0.3.3
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.2...v0.3.3)

Major Changes:

-   Updates to files that depend on compute functions
-   Configuration now overloads all available compute functions.
-   Updated Plot class to use new compute functions.
-   Removed unused objective functions (some of these may need to be
    rewritten)
-   Updated ForceErrorNodes to use the new compute functions.
-   Minor documentation changes to the compute functions.

v0.3.2
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.1...v0.3.2)

Major Changes:

-   Add solve method to Equilibrium
-   Configuration now has attributes for continuation params
    (\*\_ratios)
-   Equilibrium now has solve method which takes an Optimizer and
    Objective function and does it\'s thing.

v0.3.1
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.3.0...v0.3.1)

Major Changes:

-   revised compute functions for new polar coordinates
-   `compute_polar_coords` now handles the transforms from spectral to
    real space.
-   `compute_toroidal_coords` then converts the polar coordinates (R0,
    Z0, r, lambda) to the toroidal coordinates (R,phi,Z).
-   `compute_magnetic_field` was modified to use the non-sfl coordinate
    system.
-   Started segregating functions to only handle specific objective
    functions (force balance vs quasi-symmetry, etc).

v0.3.0
------

[Github
Commits](https://github.com/PlasmaControl/DESC/compare/v0.2.0...v0.3.0)

Major Changes:

-   Refactored all code to be object oriented

repository: PlasmaControl/DESC

repo_name: PlasmaControl/DESC


text:
---
type: TutorialStep
date: 2021-05-14
title: Source set directories
technologies: [gradle]
topics: []
author: tg
subtitle: Understand how IntelliJ IDEA deals with Gradle's source set directories
thumbnail: ./thumbnail.png
longVideo:
  poster: ./poster_long.png
  url: https://youtu.be/6V6G3RyxEMk?start=490
---

Gradle has the concept of [source sets](https://docs.gradle.org/current/dsl/org.gradle.api.tasks.SourceSet.html
) for where your code and test sources live.

Some Gradle plugins come with default source sets, for example the Java plugin has a "main" source set where the default location is `src/main/java`. IntelliJ IDEA has automatically created the source set directories for the `java` plugin for this project, we can see:
 - `src/main/java`
 - `src/main/resources`
 - `src/test/java`
 - `src/test/resources`

Try adding a new plugin which has its own source sets, e.g. `groovy`.

```groovy
plugins {
    id 'java'
    id 'groovy'
}
```

Remember to reload the build file's changes with **⇧⌘I** (macOS), or **Ctrl+Shift+O** (Windows/Linux).

IntelliJ IDEA is aware of the plugin's source sets and their directories. Go to the [project window](https://www.jetbrains.com/help/idea/project-tool-window.html) and create a new directory in the "main" folder, using **⌘N** (macOS) or **Alt+Insert** (Windows/Linux) and selecting "Directory".

![New directory name suggestions](./new-directory.png)

IntelliJ IDEA suggests a folder called "groovy" from the list of Gradle source sets. This is coloured blue as it's known to be a source set for production code.

Now we're more familiar with how our Gradle project is structured and how the build.gradle file works, let's look at how to set or change the project's [groupID and version](https://maven.apache.org/guides/mini/guide-naming-conventions.html).

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# A New Features Extraction Method based on Polynomial Regression for the assessment of Breast Lesion Contours.

Adapted from the course project for ECE F266 (Birla Institute of Technology & Science, Pilani, Hyderabad Campus 2014-15)

## Synopsis

Shape of breast Contours are prominent signs to determine malignancy in mammograms. A new algorithm for feature extraction is proposed based on polynomial regression on the signatures of benign and malignant contours. Two features mean absolute error and correlation coefficient were extracted for 57 mammograms of which 32 images were malignant contours and 25 images were benign contours. Three different pattern classifiers Support vector machine with radius basis function as kernel and sigma=0.7, Linear discriminate analysis, Bayes linear classifier methodologies were used for calculation of performance evaluation measures.Our new feature extraction method attained a remarkable recognition accuracy and Area under curve(AUC) of above 89% in all three pattern classifier techniques. Among all the three classifiers Bayes linear classifier gave good recognition accuracy of 96.29% and AUC of 0.9833.

### Prerequisites

MATLAB 2013B and above.

### Instructions

* The code to extract contours out of mammograms is not avialable yet. Hence I suggest you to use K-means with K = 3 (The tumor, rest of the body and the background) or adaptive thresholding as suggested in this [paper](http://ieeexplore.ieee.org/document/5483233/) for image segmentation and contour extraction. The Dataset should be segregated to 4 categories (Benign-train,Malignant-train,Benign-test,Malignant-test), the GUI prompts you to select the folders.
* The Images folder contains a few sample images containing countours of different cancer types. But the actual training and testing requires much larger dataset.
* The location of the data itself defines the labels, hence there is no need to worry about creating labels.
* Run the classification.m script in MATLAB.

## The Algorithm

* After segmentation of the mammogram and extracting the contours.(Benign and malignanat sample contours)
![beingn](https://user-images.githubusercontent.com/9504327/29873788-2726c9d4-8d84-11e7-9675-8b99eb546fb9.png)     ![malignant](https://user-images.githubusercontent.com/9504327/29873799-2d2476e2-8d84-11e7-86f8-587de9a0a9c8.png)
* Extracting the signatures of the contours (Benign and malignant contours respectively):
![signaturebenign](https://user-images.githubusercontent.com/9504327/29873975-c03a3c78-8d84-11e7-84b0-aab7fe65cc79.PNG)
![signaturecancerous](https://user-images.githubusercontent.com/9504327/29873976-c03be62c-8d84-11e7-99a1-e2be190ad757.PNG)
* After feeding the feature data to SVM classifier:

   ![train test_at_15](https://user-images.githubusercontent.com/9504327/29872413-169a9c8a-8d7f-11e7-8fd6-46dc79fc734e.PNG)

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/shivakshit/BenignMalignantClassification/edit/master/LICENSE) file for details

### References
* [Detection of Suspicious Lesions by Adaptive Thresholding Based on Multiresolution Analysis in Mammograms](http://ieeexplore.ieee.org/document/5483233/)

## Acknowledgments

* Thanks to Mrs. Spandana Paramkusham for extracting the contours from the mammograms using image segmentation and conducting all the performance evaluation tests. I also thank Dr. [K.M.M Rao](http://www.drkmm.com/) and [Dr. B.V.V.S.N Prabhakar Rao](http://universe.bits-pilani.ac.in/Hyderabad/bvvsnprabhakarrao/Profile) for providing invaluable guidance.

license: MIT

repository: alaabasel/BenignMalignantClassification

branch_name: refs/heads/master

repo_name: alaabasel/BenignMalignantClassification


text:
# Express

## Learning Objectives

  - Discuss why javascript is used for backend applications
  - Compare and contrast express.js to Rails / Sinatra.
  - Manage project dependencies using npm
  - Separate responsibilities by using `module.exports` and `require` to organize code
  - Simplify rendering views in express by using handlebars.js
  - Understand how to receive `POST` params by configuring and using `body-parser` middleware
  - Link to static assets in an Express application

## Opening Framing (15/15)

Let's list out the things we've covered in class...

 Html

 Css

 Javascript

 Objects

 Functions

 ES6

 SQL, Postgresql

 Ruby

 OO programming

 Sinatra

 Rails

Node

---

This is SO much stuff. We've pretty much covered the entire stack. Everything we
cover from here on out is an extension of what we've already learned or a
different language than we're used to. Today we'll be talking about [expressJS](https://expressjs.com/)
the "e" in the MEAN stack. Which incidentally is super buzz wordy right now.

Express is a framework built on top of node.

> Node.js is not a framework. It is an application runtime environment that
allows you to write server-side applications in javascript. Javascript that
does not depend on a browser.

Some frameworks, like Rails, are very opinionated frameworks.

Today, we'll be learning about Express, which is much less opinionated. Just
like Sinatra, we have a lot of freedom in how we structure our application
(folders/files, how to load different files, managing dependencies, etc)

Remember, with Node and now with Express, we are writing JS on the backend!
What are some benefits of JS on the backend?

Easy to write front and backend in same language

It's fast! Increased performance due to asynchronous processing

You have to know a little JS to work with web pages. JS is becoming the "Must Know" language for web developers

## Hello World - Express (we do 30/45)

Creating a simple hello world express application.

In the terminal:
```bash
$ mkdir hello-express
$ cd hello-express
$ npm init -y
$ npm install --save express
```

Q. What do you think npm is? (ST-WG)
---

> npm, short for node package manager. Allows us to install dependencies for our
nodeJS application. Much like how gems did this for us in Rails.

`$ npm init` will initialize a new NodeJS application. Upon initialization it
will prompt you for some user input to update the package.json. Using the `-y` argument allows you to use the defaults and not prompt for any options.

```bash
$ cat package.json
{
  "name": "hello-express",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

```

> The `package.json` file contains meta data about your app or module. More
importantly, it includes the list of dependencies to install from npm when
running npm install.

The next thing I'd like to do is install the express node module. In the
terminal:

```bash
$ npm install --save express
```

> the `--save` flag allows us to update the package.json to include the
dependency you just installed.

As we saw during `npm init`, the default file for a node app is "index.js".  We
can certainly change this, but we'll use the default for now.

Let's make a new file `$ touch index.js` and place the following contents. In
`index.js`:

```javascript
var express = require("express");
var app = express();

app.listen(4000, () => {
  console.log("app listening on port 4000");
});
```

We've required the express module. We then create another variable that invokes
the module. The app variable is where we can set up which port to listen to and
the different requests the server should listen for.

If we run the application(`$ node index.js`) we can see in the terminal `app
listening on port 4000` You'll notice that it doesn't allow us to exit this
application until we hit `cntrl + c`. This means our server is running. Let's
try going to the local host of that port number. In the browser enter
`http://localhost:4000`.

In the browser we'll see something like :

```
cannot GET /
```

OH NOES, what's going on here?

Basically we've told the server what port to listen on, but we didn't specify
what to do if a user goes to the `"/"` route. Let's update `index.js`:

```javascript
app.get("/", (req, res) => {
  res.send("Hello World");
});
```
Here, `req` is the HTTP request and `res` is the HTTP response your server sends back.

We refresh and...

```
CANNOT GET /
```

What gives? We added a route and specified the `"hello world"` string to send as
the response. Let's try restarting the server.

`Hello World`

Cool. Man, that's really unfortunate that we have to restart the server every
time we make an update to our files.

Q. What was the fix for that in Sinatra?
---

> sinatra/reloader from the sinatra-contrib repo.

Turns out express has something similar, nodemon.

In the terminal:

```bash
$ npm install --global nodemon
```

> When using the `--global` flag (-g for short), we're specifying that nodemon
will be installed "globally" (not per project) so we can utilize nodemon across
all of our node applications.

Then we start up our application a bit differently now. In the terminal:

```bash
$ nodemon index.js
```

### Q: Why not just use Node.js?

Yes, we already wrote a Node.js hello world app...why use Express?

## Params in URL in Express (5/50)

Remember parameters in our ruby frameworks? It's very similar in JS. Let's
update `index.js` to include:

```javascript
app.get("/:name", (req, res) => {
  res.send(`hello ${req.params.name}`);
});
```

## Break(10/60)

## You do: 99 Bottle of Beer(20/80)
The readme can be found [here](https://github.com/ga-wdi-exercises/99_bottles_express)

## Views (20/100)

Quick Review of the Request - Response cycle that we saw in Rails
 1. Router
 2. Controller
 3. Model
 4. View

What parts are implemented thus far with Express?

> One thing to note about views for today. We want to give you an initial
introduction into how views can be generated through templating to achieve the
same effects that erb did for us in Sinatra/Rails.

Let's leverage our [solution to 99 Bottles of
Beer](https://github.com/ga-dc/99_bottles_express/tree/solution) to learn about
views:
```
git clone https://github.com/ga-wdi-exercises/99_bottles_express.git -b solution
cd 99_bottles_express
```

Remember how we utilized erb in Sinatra and rails?  We need to be able to do the
same sort of templating with Express. For express, we'll use handlebars. To
install handlebars into our node application enter the following in the
terminal:

```bash
$ npm install --save hbs
```

Then we need to set the view engine to be handle bars inside of the `index.js`:

```javascript
app.set("view engine", "hbs");
```

Let's go ahead and create a directory and some views. In the root directory of
the express 99 bottles application. In the terminal:

```bash
$ mkdir views
$ touch views/index.hbs
$ touch views/layout.hbs
```

Let's change up our existing `index.js` to utilize a template rather than
sending in a string directly.

In `index.js`:

```javascript
// instead of
// app.get("/:numberOfBottles?", ( req, res ) => {
//   var numberOfBottles = req.params.numberOfBottles || 99
//   var next = numberOfBottles - 1
//   if (numberOfBottles > 1){
//     res.send(numberOfBottles + " bottles of beer on the wall <a href='/" + next + "'>Take one down pass it around")
//   }
//   else{
//     res.send("1 bottle of beer on the wall <a href='/'>Start Over</a>")
//   }
// })

// we want this
app.get("/:numberOfBottles?", ( req, res ) => {
  var bottles = req.params.numberOfBottles || 99;
  var next = bottles - 1;
  res.render("index", {bottles, next});
})
```

> So instead of sending a string directly to the response of that get request,
we instead want to render a view. The `.render` function takes two arguments
here. The first is the view we want to render. The second argument is an object.
We can use the keys in this object inside the view to access the values in these
key-value pairs.

The only problem is our view is empty! Let's go ahead and change that now. In
`views/layouts.hbs`:

```html
<!doctype html>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="/css/styles.css">
  </head>
  <body>
   {{{body}}}
  </body>
</html>
```

### Research: What does {{{ (triple stash) do?
 - [Handlebars.js docs](http://handlebarsjs.com/)

### Serving static assets

This is also a great time to note how we serve static assets. Notice we linked a
stylesheet in our layout file.

In our `index.js`, let's also add:
 `app.use(express.static(__dirname + '/public'))`

This allows us to utilize files in that folder in the layout.

Notice the `{{{body}}}` syntax. This is because Handlebars by default escapes
HTML and you need the additional set of brackets to indicate that you want to
render the tags in the body as HTML.

Finally we should update our index view to reflect the same strings we had
before. In `views/index.hbs`:

```html
{{bottles}} bottles of beer on the wall.
{{#if next}}
  <a href='/{{next}}'>Take One Down, Pass it Around</a>
{{else}}
  <a href='/'>Start Over</a>
{{/if}}
```

> Like in ERB, we're able to use objects in our view. Additionally we can
utilize control flow in our view as well! The syntax your seeing for the conditional statement is a built-in helper from Handlebars.

## module.exports (20/120)

`module.exports` allows us to separate our js files by exposing their contents
as one global variable. The global variable isn't assigned until we require the
file.

For example:
```js
// calculator.js
module.exports = {
  add(a,b){
    return a + b
  }
}
```

```js
// in index.js
// instantiate global variable to grant access to module we've created
var calculator = require("./calculator.js");

// use variable to call the .add() function defined in calculator.js
calculator.add(3,4)
```

Well, we can actually separate our concerns using `module.exports` If we change
our get request in `index.js`:

```js
var bottles = require("./controllers/bottles.js");
app.get("/:numberOfBottles?", bottles.index );
```

to this instead. The `./` refers to the current directory, which must be explicitly stated.
We could create a routes module that defines our index route. Let's create a `controllers/bottles.js` file with the following contents:

```js
module.exports = {
  index( req, res ){
    var bottles =
    req.params.numberOfBottles || 99;
    var next = bottles - 1;
    res.render('index',{
      bottles,
      next
    });
  }
};
```

> You can see that almost nothing has changed, really we just moved the
functionality into a different file. What advantages does that bring to us with
regard to separation of concerns in MVC? (st-wg)

You can start to see the necessity of `module.export` when we start to add
models to our application. If we had the 7 RESTful routes that rails have for
each model, you can start to see how keeping everything in the `index.js` can
begin to become unwieldy.

By using module.exports, we can effectively separate concerns and start to organize our application code. This idea of separating concerns and adhering to an MVC design allows our apps to grow while remaining easy to maintain and understand what is happening.

## Break (10/130)

## HTML Forms: Bodyparser & Post requests (20/150)

Let's incorporate the player a bit more.  Let's create a welcome page that asks for their name.

We need a route and a view (with a form)

```js
app.get("/", (req, res) => {
  res.render("welcome");
});
```

```html
<!-- views/welcome.hbs -->
<h1>Welcome to 99 Bottles</h1>
<form action="/" method="post">
  <label for="player_name">Please enter your name</label>
  <input id="player_name" type="text" name="player_name">
  <input type="submit">
</form>

```

Submit a name:

```get CANNOT POST/```

Q. How can we fix this?
---

> In `index.js`...

```js
app.post("/", (req, res) => {
  res.send("can post")
})
```

Well it works, but it's not super valuable, we're not even getting our
parameter. Let's add some stuff in `index.js`:

```js
app.post("/", (req, res) => {
  res.send("hello " + req.params.player_name)
})
```

hello undefined... oh man.. and just to be sure let's `console.log(req.params)`.
It's an empty object!

Our html form information is not in `req.params`. Express is not handling information posted from an html form.  We need to install middleware in order to get form data and JSON data in a POST request for express applications. Rails and Sinatra already include the middleware to handle this(RACK). By default express does not, so we need to install it manually.

> middleware is code that runs in between receiving the request and responding. Body-parser used to be included to express, but they took it out.

In the terminal:

```bash
$ npm install --save body-parser
```

In `index.js`:

```js
// configure app to use body parser
var bodyParser = require("body-parser");

app.use(bodyParser.json()); //handles json post requests
app.use(bodyParser.urlencoded({ extended: true })); // handles form submissions
```

Another thing to note is that, in express, `params` is always for parameters in
the url. parameters in form data is `body`

So we change the final post request in index.js to:

```js
app.post("/", (req, res) => {
  res.send(`hello ${req.body.player_name}`)
})
```

And finally, use it in our app:

Update index.js:

```js
app.post("/", (req, res) => {
  res.render("index", {
    player_name: req.body.player_name,
    bottles: 99,
    next: 98
  });
});
```

And to our view:
```html
{{#if player_name}}
  Hey {{player_name}}, there are
{{/if}}
```

:tada:

***GET params with res.params***
***POST params with res.body***, using body-parser middleware

## You Do - POST data and store it in a cookie (30 minutes)

We can persist data temporarily in a cookie. If we wanted to perist data across requests securely, we would store the data in some kind of persistant storage, like a database.

In groups of 2 or 3, work together to implement storing POSTed data in cookies.

Check out the Express API docs and review how to POST data. Look at how Express implements cookies, and create a route that, when POST data is received, stores data in cookies

Since we don't have a form ready, you could either build a form in a view, like we did to requst the `player_name` above. Alternatively, think of your backend code as an API. How can you POST to an api without using the browser?

https://expressjs.com/en/api.html

(Hint: you will need middleware to start working with cookies)

### Bonus: use cURL or Postman to send POST to your route

## Homework: Ultimate Compliment

* [Ultimate Compliment](https://github.com/ga-dc/compliment-express)
  * You might want to look at the [Sinatra Version Solution](https://github.com/ga-dc/emergency_compliment/tree/solution)

## Sample Quiz Questions
- What is `npm`?

- Write a get request using any path as you would in an express application.

- How does `module.exports` help us with separation of concerns?

### Other frameworks based on Express

 - Express Generator
 - [KoaJS](https://github.com/koajs/koa)

### In the Wild

 - [Why Netflix got burned](https://www.infoq.com/news/2014/12/expressjs-burned-netflix)

repository: patrickthesailorman/express-intro

repo_name: patrickthesailorman/express-intro


text:
# Mastering Hadoop 3

This is the code repository for [Mastering Hadoop 3](https://www.packtpub.com/big-data-and-business-intelligence/mastering-hadoop-3?utm_source=github&utm_medium=repository&utm_campaign=9781788620444), published by Packt.

**Big data processing at scale to unlock unique business insights**

## What is this book about?
Apache Hadoop is one of the most popular big data solutions for distributed storage and for processing large chunks of data. With Hadoop 3, Apache promises to provide a high-performance, more fault-tolerant, and highly efficient big data processing platform, with a focus on improved scalability and increased efficiency.

This book covers the following exciting features:
* Gain an in-depth understanding of distributed computing using Hadoop 3
* Develop enterprise-grade applications using Apache Spark, Flink, and more
* Build scalable and high-performance Hadoop data pipelines with security, monitoring, and data governance
* Explore batch data processing patterns and how to model data in Hadoop
* Master best practices for enterprises using, or planning to use, Hadoop 3 as a data platform

If you feel this book is for you, get your [copy](https://www.amazon.com/dp/1788-620445) today!

## Instructions and Navigations
All of the code is organized into folders. For example, Chapter02.

The code will look like the following:
```
<property>
  <name>dfs.ha.namenodes.mycluster</name>
  <value>nn1,nn2,nn3</value>
</property>
```

**Following is what you need for this book:**
If you want to become a big data professional by mastering the advanced concepts of Hadoop, this book is for you. You’ll also find this book useful if you’re a Hadoop professional looking to strengthen your knowledge of the Hadoop ecosystem. Fundamental knowledge of the Java programming language and basics of Hadoop is necessary to get started with this book.

With the following software and hardware list you can run all code files present in the book.

### Software and Hardware List

| Chapter  | Software required                   | OS required           |
| -------- | ------------------------------------| ----------------------|
| 1 -15    | OpenJDK 1.8.0_171 64 bit/           |    Ubuntu 16.04.3_LTS |
|          | Apache Hadoop-3.1.0, VMWare         |                       |

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. [Click here to download it](https://www.packtpub.com/sites/default/files/downloads/9781788620444_ColorImages.pdf).

## Code in Action

Click on the following link to see the Code in Action:

[http://bit.ly/2XvW2SD](http://bit.ly/2XvW2SD)

### Related products <Other books you may enjoy>
* Big Data Analytics with Hadoop 3 [[Packt]](https://www.packtpub.com/big-data-and-business-intelligence/big-data-analytics-hadoop-3?utm_source=github&utm_medium=repository&utm_campaign=9781788628846) [[Amazon]](https://www.amazon.com/dp/1788628845)

* Apache Spark 2.x Machine Learning Cookbook [[Packt]](https://www.packtpub.com/big-data-and-business-intelligence/apache-spark-machine-learning-cookbook?utm_source=github&utm_medium=repository&utm_campaign=9781783551606) [[Amazon]](https://www.amazon.com/dp/1786462745)

## Get to Know the Authors
**Chanchal Singh**
has over half decades experience in Product Development and Architect Design. He has been working very closely with leadership team of various companies including directors ,CTO's and Founding members to define technical road-map for company.He is the Founder and Speaker at meetup group Big Data and AI Pune MeetupExperience Speaks. He is Co-Author of Book Building Data Streaming Application with Apache Kafka. He has a Bachelor's degree in Information Technology from the University of Mumbai and a Master's degree in Computer Application from Amity University. He was also part of the Entrepreneur Cell in IIT Mumbai. His Linkedin Profile can be found at with the username Chanchal Singh.

**Manish Kumar**
is a technical architect at DataMetica Solution Pvt. Ltd. He has approximately 11 years' experience in data management, working as a data architect and product architect. He has extensive experience of building effective ETL pipelines, implementing security over Hadoop, and providing the best possible solutions to data science problems. Before joining the world of big data, he worked as a tech lead for Sears Holding, India. Manish has a bachelor's degree in information technology, and he is a coauthor of Building Data Streaming Applications with Apache Kafka.

## Other books by the authors
* [Building Data Streaming Applications with Apache Kafka](https://www.packtpub.com/big-data-and-business-intelligence/building-data-streaming-applications-apache-kafka?utm_source=github&utm_medium=repository&utm_campaign=9781787283985)
### Suggestions and Feedback
[Click here](https://docs.google.com/forms/d/e/1FAIpQLSdy7dATC6QmEL81FIUuymZ0Wy9vH1jHkvpY57OiMeKGqib_Ow/viewform) if you have any feedback or suggestions.
### Download a free PDF

 If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.

 https://packt.link/free-ebook/9781788620444


text:
---
layout: page
title: Contact
permalink: /contact/
---

In case you have any questions or comments on eWaterCycle you can reach us at<EMAIL_ADDRESS>
To be the first to hear about any new developments, you can also signup for our newsletter (max 5 messages per year) below, or [here](https://docs.google.com/forms/d/e/1FAIpQLSeIMhqi0hIkhin9TQrctbxakcBoK4VkrSs7bYVSxnz5OLHvqw/viewform?usp=sf_link)

<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSeIMhqi0hIkhin9TQrctbxakcBoK4VkrSs7bYVSxnz5OLHvqw/viewform?embedded=true" width="640" height="1200" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>

gha_language: HTML


text:
# plant-guard

[![Click to watch](https://img.youtube.com/vi/59vS7RXK-lc/0.jpg)](https://www.youtube.com/watch?v=59vS7RXK-lc "Click to watch")

A simple plant watering machine.
Used parts:
  - Raspberry Pi 3 B+
  - Submersible Low Noise Motor Pump 3-6V
  - Motor driver l293d
  - Stepper motor 28BYJ-48 with driver
  - Silicon hose
  - Bucket
  - [3d-printed parts](models)
  - dupont cables, screws, ...

No sensors are used for now, you will need to set appropriate timing for the frequency and duration of the watering (Keep in mind the watering will be slower when the bucket is emptier).

Usage:
  1. Assemble using the datasheets of the components (GPIO pins for the pump driver are 5 (->IN1) and 6 (->IN2), GPIO pins for the stepper motor driver are 24, 23, 22, 27 (-> IN1, IN2, IN3, IN4)) and mount onto the bucket
  2. `ssh<EMAIL_ADDRESS>  3. `git clone https://github.com/afrixs/plant-guard.git`
  4. `pip3 install python_crontab pyyaml portalocker`
  5.  Use arrow keys to move the arm. Repeat the last arrow key stroke to stop. When the arm is above the plant being configured use 'f' key to set `angle_from`. Optionally move the arm a little bit and use 't' key to set `angle_to`. The arm will be moving between `angle_from` and `angle_to` during the watering so that water does not fall to a single spot only.
  8. Use 'p' key to start/stop the pump. Duration of pumping will be stored to `pump_dur`.
  9. Use 'Enter' key to create a watering job. Enter a name for the job and a crontab time entry
  10. The watering job is scheduled. Repeat 6.-8. for another plant
  11. Use 'l' key to list all jobs, 'd' key to delete a single job or 'x' key to delete all jobs
  12. Use 'q' or 'Esc' key to quit the job configuration client. Lock for controlling motors is released and scheduled jobs are free to run
  13. You can now use Ctrl+D to logout from ssh

Note: You may edit the jobs afterwards using `crontab -e` or `nano ~/plant-guard/jobs.yaml`.

Important note: don't turn the stepper motor manually after the first start or the configuration will be broken. If you need (or accidentally happen) to turn it, use `rm ~/plant-guard/save.txt; rm ~/plant-guard/save_backup.txt` and follow steps 5. - 12. to reconfigure (or turn the motor back to its original position, hoping the difference will not be critical).

Important note: Also when leaving the device to operate without your attendance for a longer time, prepare the place in a way that no firm or big leaves capable of blocking the movement of the arm will grow in its way.

First test was successful: Here are images of our plants before and after leaving the apartment for 9 days. I think they liked it

![t = 0](docs/photo_t_0days.jpg)
![t = 9 days](docs/photo_t_8days.jpg)

repository: afrixs/plant-guard

repo_name: afrixs/plant-guard


text:
# GOverwatch
GOverwatch is a tool written in go to get the actual Demo from CS:GO Overwatch and find out who's the suspect.

## Installation
Download the goverwatch.exe including the config.json.
Refer to the Configuration part in this README or instructions by the program.

Also you need to install [npcap](https://nmap.org/npcap/windows-10.html) which is used to sniff your network traffic.

Alternatively clone this repo and compile it yourself
```go build -o goverwatch.exe main.go```

## Usage
Start GOverwatch, after finding the Demo it will prompt you and ask in which round your overwatch case started at.

![alt text](https://i.imgur.com/lbsgVlp.png "GOverwatch Demo 01")

After the last player has been parsed GOverwatch will prompt you again and asks if it should advance to the next round.

Whith this you are able to find the real suspect by comparing the stats.

## Configuration
To be able to get the profile links aswell you need to fill in your SteamWebApiKey which you can obtain on this site.
https://steamcommunity.com/dev/apikey
```json
{
  "steamWebApiKey": "youre API Key here",
  "networkDevice": "\\Device\\NPF_{ABCDE-EFGHI-JKMLNOP123456}"
}
```
Notice the two backticks to mask the second backtick otherwise json would interpret something there

In conclusion convert:

```\Device\NPF_{ABCDE-EFGHI-JKMLNOP123456}```

to

```\\Device\\NPF_{ABCDE-EFGHI-JKMLNOP123456}```

**How do I find my device?**

Simply don't fill out the "networkDevice" GOverwatch will list all available devices

For further questions don't hesitate to open an issue

repository: flopana/GOverwatch

repo_name: flopana/GOverwatch


text:
# NJBW
Node + Jade(Pug) + Bootstap + Webpack

Boilerplate code.

Install with:
`npm install`

or

With npm:
`npm install njbw`

Load and sever to a webpack dev server using:
` npm run dev`

Compile to dist/ using :
` npm run prod`

Clean dist/ using:
`npm clean`

Change `entry` in `webpack.config.js` to point to your entry script, change the template in the HtmlWebpackPlugin object to point to your pug template. Boostrap is included, just write your template and viola! include images using `img(src=require(./path-to-your-file))`

repository: nickfierro/NJBW

repo_name: nickfierro/NJBW


text:
---
title: Item Reorder
page_title: RadListView Item reorder | Progress NativeScript UI Documentation
description: This article discusses the item reorder feature of RadListView and it is used with Vue.
slug: listview-features-item-reorder-vue
tags: radlistview, reorder, vue, nativescript, professional, ui
position: 9
publish: true
---

# RadListView Item Reorder
The item reorder feature allows the end users to change the position of an item by dragging it. This is particularly useful in scenarios where lists of items with priorities are created. Reordering an item is used to change the item's priority. The Item Reorder feature is enabled by setting the `itemReorder` property to `true`.

# Example
The following simple scenario demonstrates how the item-reorder feature is used. A handler for the `itemReordered` event is provided which prints out the indices of the item being reordered.

```
export default {
  template: `
  <Page>
    <StackLayout>
      <RadListView ref="listView"
                   for="item in itemList"
                   itemReorder="true"
                   @itemReordered="onItemReordered">
        <v-template>
          <StackLayout>
            <Label :text="item.name"></Label>
          </StackLayout>
        </v-template>
      </RadListView>
    </StackLayout>
  </Page>
  `,
  data () {
    return {
      itemList: [
        {name: 'Item 1'},
        {name: 'Item 2'},
        {name: 'Item 3'},
      ],
      selectedItems: [],
    };
  },
  methods: {
    onItemReordered({ index, data, object }) {
      console.log(`Item reordered from index ${index} to ${data.targetIndex}`);
    },
  }
};
```

repository: westlakem/docs

repo_name: westlakem/docs


text:
# Memory Matching Game

A simple game to test your memory if you can remember what cards were flipped open

## Getting Started

Just extract the code base and run the index.html on any browser.

### Prerequisites

All you need is just the browser

### Installing

The source code to download is available in the below git repository. Just download it into your local and run the index.html

```
https://github.com/tinduEdward/matching-game
```

## Built With

* [Font Awesome](https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css) -

## Authors

* *Derlin Kulandai Raj** - *Initial work* - [tinduEdward](https://github.com/tinduEdward/matching-game)

See also the list of [contributors](https://github.com/your/project/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: tinduEdward/matching-game

repo_name: tinduEdward/matching-game


text:
# Row

Row objects are returned from Cursor fetch functions.  As specified in the DB API, they are
tuple-like.

    row = cursor.fetchone()
    print(row[0])

However, there are some pyodbc additions that make them very convenient:

* Values can be accessed by column name.
* The Cursor.description values can be accessed from the row.
* Values can be replaced
* Rows from the same select share memory.

Accessing rows by column name is very convenient, readable, and Pythonish:

    cursor.execute("select album_id, photo_id from photos where user_id=1")
    row = cursor.fetchone()
    print(row.album_id, row.photo_id)
    print(row[0], row[1]) # same as above, but less readable

Having access to the cursor's description, even after the curosr is closed, makes Rows very
convenient data structures -- you can pass them around and they are self describing:

    def getuser(userid):
        cnxn = pyodbc.connect(...)
        cursor = cnxn.cursor()
        return cursor.execute(
            """
            select album_id, photo_id
            from photos
            where user_id = ?
            """, userid).fetchall()

    row = getuser(7)
    # At this point the cursor has been closed and deleted
    # But the columns and datatypes can still be accessed:
    print('columns:', ', '.join(t[0] for t in row.cursor_description))

Unlike normal tuples, values in Row objects can be replaced.  (This means you shouldn't use
rows as dictionary keys!)

The intention is to make Rows convenient data structures to replace small or short-lived
classes.  While SQL is powerful, there are sometimes slight changes that need to be made after
reading values:

    # Replace the 'start_date' datetime in each row with one that has a time zone.
    rows = cursor.fetchall()
    for row in rows:
    row.start_date = row.start_date.astimezone(tz)

Note that slicing rows returns tuples, not Row objects!

## Variables

### cursor_description

A copy of the Cursor.description object from the Cursor that created this row.  This contains
the column names and data types of the columns.

repository: atleypnorth/pyodbc

repo_name: atleypnorth/pyodbc


text:
# Protobuf

[Protocol Buffers](https://github.com/protocolbuffers/protobuf) (a.k.a., protobuf)
are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.

Protobuf is a binary serialization format, which has many advantages but it comes at a price:
when debugging/troubleshooting/exploring a system that contains serialized binary blobs one
ends up inventing new swear words at the tune of ^H<C0><84>=^Z^D^H^B^Z^@!! and yelling them aloud,
at the great confusion of the their significant other.

Tools always come to the rescue, but public protobuf tooling is embarrassingly behind.

## prototxt

The `protoc` tool can (de)serialize to and from binary protobuf files,
with the `--decode` and `--encode` flags. However, it needs to be passed the schema of the files *and*
the fully qualified type name of the top level message in the file to be decoded.

We have a script that hides the boring parts of finding all the `.proto` files and adding the right
import paths etc. It also has a convenient command that lists all the fully qualified message types.

```console
$ ./scripts/prototxt types | grep DatabaseRules
influxdata.iox.management.v1.DatabaseRules
```

You can now decode the binary protobuf into a textual form you can inspect and/or edit:

```console
$ ./scripts/prototxt decode influxdata.iox.management.v1.DatabaseRules \
    < /tmp/iox-data/1/foobar_weather/rules.pb
name: "foobar_weather"
partition_template {
  parts {
    time: "%Y-%m-%d %H:00:00"
  }
}
mutable_buffer_config {
  buffer_size: 1000000
  partition_drop_order {
    order: ORDER_DESC
    created_at_time {
    }
  }
}
```

You can edit the file and then re-encode it back into binary protobuf:
```console
$ ./scripts/prototxt encode influxdata.iox.management.v1.DatabaseRules \
   < /tmp/rules.txt \
   > /tmp/iox-data/1/foobar_weather/rules.pb
$ cat /tmp/iox-data/1/foobar_weather/rules.pb | hexdump -C
00000000  0a 0e 66 6f 6f 62 61 72  5f 77 65 61 74 68 65 72  |..foobar_weather|
00000010  12 15 0a 13 1a 11 25 59  2d 25 6d 2d 25 64 20 25  |......%Y-%m-%d %|
00000020  48 3a 30 30 3a 30 30 3a  0a 08 c0 84 3d 1a 04 08  |H:00:00:....=...|
00000030  02 1a 00                                          |...|
```

## Textpb

The textual protobuf encoding (aka `textpb`) may be unfamiliar to most people.
There is no public specification and implementors just reference the C++ protobuf impl.
It's superseded by the `jsonpb` syntax, but you're likely to have to interact with `textpb` for a while,
at least until there is better support for `jsonpb` in commandline tools.

Quick&dirty doc:

1. It's not JSON
2. It's a faithful translation of the original binary message.
3. It uses the schema to map between field tags and field names.
4. In protobuf, the top level is always a message. Textpb is the same.
5. When a field value is an message, use `{}`. (see below of alternative renderings).
6. Repeated fields are not arrays, they are literally repeated fields.

There is a way to visualize a binary protobuf even if you don't know the schema:

```console
$ protoc --decode_raw </tmp/iox-data/1/foobar_weather/rules.pb
1: "foobar_weather"
2 {
  1 {
    3: "%Y-%m-%d %H:00:00"
  }
}
7 {
  1: 1000000
  3 {
    1: 2
    3: ""
  }
}
```

If you compare this carefully with the output of `./scripts/prototxt decode influxdata.iox.management.v1.DatabaseRules` shown above
you'll notice that it has exactly the same data, and only the labels of the fields change.

Thus, if you understand how the protobuf binary encoding lays down their fields, you'll understand `textpb`.

For example, "arrays" are fields with the same tag appearing multiple times in the same message.
They don't even need to appear consecutively.

### Alt-renderings

To complicate matters further, there are alternative renderings of `textpb`. These are all valid:

```
  parts: {
    time: "%Y-%m-%d %H:00:00"
  }
  parts: <
    time: "%Y-%m-%d %H:00:00"
  >
  parts <
    time: "%Y-%m-%d %H:00:00"
  >
```

(echoes of a distant past, when JSON wasn't a thing yet).

gha_license_id: NOASSERTION


text:
---
section: self-hosted/latest
subsection: troubleshooting
title: Config Patches
---

<script context="module">
  export const prerender = true;
</script>

# Gitpod Configuration Patches

> ⚠ **Self-hosted as a product is no longer supported**
>
> The last official update of this product is the [November 2022 self-hosted release](https://www.gitpod.io/changelog/november-self-hosted-release). We no longer sell commercial self-hosted licenses. If you want to self-host Gitpod, you can still request our [free community license](https://www.gitpod.io/community-license). However, we no longer offer support or updates for it. If you are interested in an isolated, private installation of Gitpod, take a look at [Gitpod Dedicated](/dedicated).
> Read [our blog on Gitpod Dedicated](/blog/introducing-gitpod-dedicated) to learn why we made the decision to discontinue self-hosted.

Further customization of your installation is possible within the installation UI, where Gitpod can provide you with a config patch to tailor the installation to your specific needs. In the “Additional Options” section, click the “Enable additional options” checkbox, and upload the file in the “Gitpod config patch” field.

![config patch](../../static/images/docs/self-hosted/config-patch.png)

The patch file is effectively a patch for the internally used [Gitpod Installer config file](https://github.com/gitpod-io/gitpod/blob/main/install/installer/example-config.yaml). It gives you access to all configuration options that Gitpod accepts - even those not present in the UI. All values that are set in the patch file will override the generated config file values.

gha_license_id: MIT


text:
# osxaliases.py

### Create, manipulate and resolve Mac OS X aliases.

## About
Mac OSX aliases are not symbolic links. Trying to read one will probably crash your code.

#### public functions

`is_alias(path)` Returns true if a file is an OSX alias, false otherwise.

`create_osx_alias(filename, aliasname)` creates an alias pointing to file.

`resolve_osx_alias(path)` Returns the full path of the file pointed to by the alias.

#### commandline
When run from command line accept one argument, an alias, and resolve it.

Based on this blog post and code by : Scott H. Hawley:
https://drscotthawley.github.io/Resolving-OSX-Aliases/

## Installation
 * System requirement: Python 3.x

## Usage:

usage: osxaliases.py [-h] file

Resolve OSX alias

positional arguments:
  file        alias file to resolve

optional arguments:
  -h, --help  show this help message and exit

## License
See [UNLICENSE](UNLICENSE) file

license: Unlicense

repository: uglygus/osxaliases

repo_name: uglygus/osxaliases