text:
"""
mfuzf1 module.  Contains the ModflowUzf1 class. Note that the user can access
the ModflowUzf1 class as `flopy.modflow.ModflowUzf1`.

Additional information for this MODFLOW package can be found at the `Online
MODFLOW Guide
<https://water.usgs.gov/nrp/gwsoftware/modflow2000/MFDOC/index.html?uzf_unsaturated_zone_flow_pack.htm>`_.

"""
import warnings

import numpy as np

from ..pakbase import Package
from ..utils import Transient2d, Util2d
from ..utils.flopy_io import line_parse, multi_line_strip, pop_item
from ..utils.optionblock import OptionBlock

class ModflowUzf1(Package):
    """
    MODFLOW Unsaturated Zone Flow 1 Boundary Package Class.

    Parameters
    ----------
    model : model object
        The model object (of type :class:`flopy.modflow.mf.Modflow`) to which
        this package will be added.
    nuztop : integer
        used to define which cell in a vertical column that recharge and
        discharge is simulated. (default is 1)

        1   Recharge to and discharge from only the top model layer. This
            option assumes land surface is defined as top of layer 1.
        2   Recharge to and discharge from the specified layer in variable
            IUZFBND. This option assumes land surface is defined as top of
            layer specified in IUZFBND.
        3   Recharge to and discharge from the highest active cell in each
            vertical column. Land surface is determined as top of layer
            specified in IUZFBND. A constant head node intercepts any recharge
            and prevents deeper percolation.

    iuzfopt : integer
        equal to 1 or 2. A value of 1 indicates that the vertical hydraulic
        conductivity will be specified within the UZF1 Package input file using
        array VKS. A value of 2 indicates that the vertical hydraulic
        conductivity will be specified within either the BCF or LPF Package
        input file. (default is 0)
    irunflg : integer
        specifies whether ground water that discharges to land surface will
        be routed to stream segments or lakes as specified in the IRUNBND
        array (IRUNFLG not equal to zero) or if ground-water discharge is
        removed from the model simulation and accounted for in the
        ground-water budget as a loss of water (IRUNFLG=0). The
        Streamflow-Routing (SFR2) and(or) the Lake (LAK3) Packages must be
        active if IRUNFLG is not zero. (default is 0)
    ietflg : integer
        specifies whether or not evapotranspiration (ET) will be simulated.
        ET will not be simulated if IETFLG is zero, otherwise it will be
        simulated. (default is 0)
    ipakcb : integer
        flag for writing ground-water recharge, ET, and ground-water
        discharge to land surface rates to a separate unformatted file using
        subroutine UBUDSV. If ipakcb>0, it is the unit number to which the
        cell-by-cell rates will be written when 'SAVE BUDGET' or a non-zero
        value for ICBCFL is specified in Output Control. If ipakcb less than
        or equal to 0, cell-by-cell rates will not be written to a file.
        (default is 57)
    iuzfcb2 : integer
        flag for writing ground-water recharge, ET, and ground-water
        discharge to land surface rates to a separate unformatted file using
        module UBDSV3. If IUZFCB2>0, it is the unit number to which
        cell-by-cell rates will be written when 'SAVE BUDGET' or a non-zero
        value for ICBCFL is specified in Output Control. If IUZFCB2 less than
        or equal to 0, cell-by-cell rates will not be written to file.
        (default is 0)
    ntrail2 : integer
        equal to the number of trailing waves used to define the
        water-content profile following a decrease in the infiltration rate.
        The number of trailing waves varies depending on the problem, but a
        range between 10 and 20 is usually adequate. More trailing waves may
        decrease mass-balance error and will increase computational
        requirements and memory usage. (default is 10)
    nsets : integer
        equal to the number of wave sets used to simulate multiple
        infiltration periods. The number of wave sets should be set to 20 for
        most problems involving time varying infiltration. The total number of
        waves allowed within an unsaturated zone cell is equal to
        NTRAIL2*NSETS2. An error will occur if the number of waves in a cell
        exceeds this value. (default is 20)
    surfdep : float
        The average height of undulations, D (Figure 1 in UZF documentation),
        in the land surface altitude. (default is 1.0)
    iuzfbnd : integer
        used to define the aerial extent of the active model in which recharge
        and discharge will be simulated. (default is 1)
    irunbnd : integer
        used to define the stream segments within the Streamflow-Routing
        (SFR2) Package or lake numbers in the Lake (LAK3) Package that
        overland runoff from excess infiltration and ground-water
        discharge to land surface will be added. A positive integer value
        identifies the stream segment and a negative integer value identifies
        the lake number. (default is 0)
    vks : float
        used to define the saturated vertical hydraulic conductivity of the
        unsaturated zone (LT-1). (default is 1.0E-6)
    eps : float
        values for each model cell used to define the Brooks-Corey epsilon of
        the unsaturated zone. Epsilon is used in the relation of water
        content to hydraulic conductivity (Brooks and Corey, 1966).
        (default is 3.5)
    thts : float
        used to define the saturated water content of the unsaturated zone in
        units of volume of water to total volume (L3L-3). (default is 0.35)
    thtr : float
        used to define the residual water content for each vertical column of
        cells in units of volume of water to total volume (L3L-3). THTR is
        the irreducible water content and the unsaturated water content
        cannot drain to water contents less than THTR. This variable is not
        included unless the key word SPECIFYTHTR is specified. (default is
        0.15)
    thti : float
        used to define the initial water content for each vertical column of
        cells in units of volume of water at start of simulation to total
        volume (L3L-3). THTI should not be specified for steady-state
        simulations. (default is 0.20)
    row_col_iftunit_iuzopt : list
        used to specify where information will be printed for each time step.
        row and col are zero-based. IUZOPT specifies what that information
        will be. (default is [])
        IUZOPT is

        1   Prints time, ground-water head, and thickness of unsaturated zone,
            and cumulative volumes of infiltration, recharge, storage, change
            in storage and ground-water discharge to land surface.
        2   Same as option 1 except rates of infiltration, recharge, change in
            storage, and ground-water discharge also are printed.
        3   Prints time, ground-water head, thickness of unsaturated zone,
            followed by a series of depths and water contents in the
            unsaturated zone.

    nwt_11_fmt : boolean
        flag indicating whether or not to utilize a newer (MODFLOW-NWT
        version 1.1 or later) format style, i.e., uzf1 optional variables
        appear line-by-line rather than in a specific order on a single
        line. True means that optional variables (e.g., SPECIFYTHTR,
        SPECIFYTHTI, NOSURFLEAK) appear on new lines. True also supports
        a number of newer optional variables (e.g., SPECIFYSURFK,
        REJECTSURFK, SEEPSURFK). False means that optional variables
        appear on one line.  (default is False)
    specifythtr : boolean
        key word for specifying optional input variable THTR (default is 0)
    specifythti : boolean
        key word for specifying optional input variable THTI. (default is 0)
    nosurfleak : boolean
        key word for inactivating calculation of surface leakage.
        (default is 0)
    specifysurfk : boolean
        (MODFLOW-NWT version 1.1 and MODFLOW-2005 1.12 or later)
        An optional character variable. When SPECIFYSURFK is specified,
        the variable SURFK is specified in Data Set 4b.
    rejectsurfk : boolean
        (MODFLOW-NWT version 1.1 and MODFLOW-2005 1.12 or later)
        An optional character variable. When REJECTSURFK is specified,
        SURFK instead of VKS is used for calculating rejected infiltration.
        REJECTSURFK only is included if SPECIFYSURFK is included.
    seepsurfk : boolean
        (MODFLOW-NWT version 1.1 and MODFLOW-2005 1.12 or later)
        An optional character variable. When SEEPSURFK is specified,
        SURFK instead of VKS is used for calculating surface leakage.
        SEEPSURFK only is included if SPECIFYSURFK is included.
    etsquare : float (smoothfact)
        (MODFLOW-NWT version 1.1 and MODFLOW-2005 1.12 or later)
        An optional character variable. When ETSQUARE is specified,
        groundwater ET is simulated using a constant potential ET rate,
        and is smoothed over a specified smoothing interval.
        This option is recommended only when using the NWT solver.

        etsquare is activated in flopy by specifying a real value
        for smoothfact (default is None).
        For example, if the interval factor (smoothfact)
        is specified as smoothfact=0.1 (recommended),
        then the smoothing interval will be calculated as:
        SMOOTHINT = 0.1*EXTDP and  is applied over the range for groundwater
        head (h):
        *   h < CELTOP-EXTDP, ET is zero;
        *   CELTOP-EXTDP < h < CELTOP-EXTDP+SMOOTHINT, ET is smoothed;
        CELTOP-EXTDP+SMOOTHINT < h, ET is equal to potential ET.
    uzgage : dict of lists or list of lists
        Dataset 8 in UZF Package documentation. Each entry in the dict
        is keyed by iftunit.
            Dict of lists: If iftunit is negative, the list is empty.
            If iftunit is positive, the list includes [IUZROW, IUZCOL, IUZOPT]
            List of lists:
            Lists follow the format described in the documentation:
            [[IUZROW, IUZCOL, IFTUNIT, IUZOPT]] or [[-IFTUNIT]]
    netflux : list of [Unitrech (int), Unitdis (int)]
        (MODFLOW-NWT version 1.1 and MODFLOW-2005 1.12 or later)
        An optional character variable. When NETFLUX is specified,
        the sum of recharge (L3/T) and the sum of discharge (L3/T) is written
        to separate unformatted files using module UBDSV3.

        netflux is activated in flopy by specifying a list for
        Unitrech and Unitdis (default is None).
        Unitrech and Unitdis are the unit numbers to which these values
        are written when "SAVE BUDGET" is specified in Output Control.
        Values written to Unitrech are the sum of recharge values
        for the UZF, SFR2, and LAK packages, and values written to Unitdis
        are the sum of discharge values for the UZF, SFR2, and LAK packages.
        Values are averaged over the period between output times.

        [NETFLUX unitrech unitdis]
    finf : float, 2-D array, or dict of {kper:value}
        where kper is the zero-based stress period
        to assign a value to.  Value should be cast-able to Util2d instance
        can be a scalar, list, or ndarray is the array value is constant in
        time.
        Used to define the infiltration rates (LT-1) at land surface for each
        vertical column of cells. If FINF is specified as being greater than
        the vertical hydraulic conductivity then FINF is set equal to the
        vertical unsaturated hydraulic conductivity. Excess water is routed
        to streams or lakes when IRUNFLG is not zero, and if SFR2 or LAK3 is
        active. (default is 1.0E-8)
    pet : float, 2-D array, or dict of {kper:value}
        where kper is the zero-based stress period
        to assign a value to.  Value should be cast-able to Util2d instance
        can be a scalar, list, or ndarray is the array value is constant in
        time.
        Used to define the ET demand rates (L1T-1) within the ET extinction
        depth interval for each vertical column of cells. (default is 5.0E-8)
    extdp : float, 2-D array, or dict of {kper:value}
        where kper is the zero-based stress period
        to assign a value to.  Value should be cast-able to Util2d instance
        can be a scalar, list, or ndarray is the array value is constant in
        time.
        Used to define the ET extinction depths. The quantity of ET removed
        from a cell is limited by the volume of water stored in the
        unsaturated zone above the extinction depth. If ground water is
        within the ET extinction depth, then the rate removed is based
        on a linear decrease in the maximum rate at land surface and zero at
        the ET extinction depth. The linear decrease is the same method used
        in the Evapotranspiration Package (McDonald and Harbaugh, 1988, chap.
        10). (default is 15.0)
    extwc : float, 2-D array, or dict of {kper:value}
        where kper is the zero-based stress period
        to assign a value to.  Value should be cast-able to Util2d instance
        can be a scalar, list, or ndarray is the array value is constant in
        time.
        Used to define the extinction water content below which ET cannot be
        removed from the unsaturated zone.  EXTWC must have a value between
        (THTS-Sy) and THTS, where Sy is the specific yield specified in
        either the LPF or BCF Package. (default is 0.1)
     air_entry : float, 2-D array, or dict of {kper: value}
        where kper is the zero-based stress period.
        Used to define the air entry pressure of the unsaturated zone in
        MODFLOW-NWT simulations
    hroot : float, 2-D array, or dict of {kper: value}
        where kper is the zero-based stress period.
        Used to define the pressure potential at roots in the unsaturated
        zone in MODFLOW-NWT simulations
    rootact : float, 2-D array, or dict of {kper: value}
        where kper is the zero-based stress period.
        Used to define the root activity in the unsaturated
        zone in MODFLOW-NWT simulations
    uzfbud_ext : list
        appears to be used for sequential naming of budget output files
        (default is [])
    extension : string
        Filename extension (default is 'uzf')
    unitnumber : int
        File unit number (default is None).
    filenames : str or list of str
        Filenames to use for the package and the output files. If
        filenames=None the package name will be created using the model name
        and package extension and the cbc output, uzf output, and uzf
        observation names will be created using the model name and .cbc,
        uzfcb2.bin, and  .uzf#.out extensions (for example, modflowtest.cbc,
        and modflowtest.uzfcd2.bin), if ipakcbc, iuzfcb2, and len(uzgag) are
        numbers greater than zero. For uzf observations the file extension is
        created using the uzf observation file unit number (for example, for
        uzf observations written to unit 123 the file extension would be
        .uzf123.out). If a single string is passed the package name will be
        set to the string and other uzf output files will be set to the model
        name with the appropriate output file extensions. To define the names
        for all package files (input and output) the length of the list of
        strings should be 3 + len(uzgag). Default is None.
    surfk : float
        An optional array of positive real values used to define the hydraulic
        conductivity (LT-1). SURFK is used for calculating the rejected
        infiltration and/or surface leakage. IF SURFK is set greater than
        VKS then it is set equal to VKS. Only used if SEEPSURFK is True.

    Attributes
    ----------
    nuzgag : integer (deprecated - counter is set based on length of uzgage)
        equal to the number of cells (one per vertical column) that will be
        specified for printing detailed information on the unsaturated zone
        water budget and water content. A gage also may be used to print
        the budget summed over all model cells.  (default is None)

    Methods
    -------

    See Also
    --------

    Notes
    -----
    Parameters are not supported in FloPy.

    Examples
    --------

    >>> import flopy
    >>> ml = flopy.modflow.Modflow()
    >>> uzf = flopy.modflow.ModflowUzf1(ml, ...)

    """

    _options = dict(
        [
            ("specifythtr", OptionBlock.simple_flag),
            ("specifythti", OptionBlock.simple_flag),
            ("nosurfleak", OptionBlock.simple_flag),
            ("specifysurfk", OptionBlock.simple_flag),
            ("rejectsurfk", OptionBlock.simple_flag),
            ("seepsurfk", OptionBlock.simple_flag),
            ("capillaryuzet", OptionBlock.simple_flag),
            (
                "etsquare",
                {
                    OptionBlock.dtype: np.bool_,
                    OptionBlock.nested: True,
                    OptionBlock.n_nested: 1,
                    OptionBlock.vars: {"smoothfact": OptionBlock.simple_float},
                },
            ),
            (
                "netflux",
                {
                    OptionBlock.dtype: np.bool_,
                    OptionBlock.nested: True,
                    OptionBlock.n_nested: 2,
                    OptionBlock.vars: dict(
                        [
                            ("unitrech", OptionBlock.simple_int),
                            ("unitdis", OptionBlock.simple_int),
                        ]
                    ),
                },
            ),
            ("savefinf", OptionBlock.simple_flag),
        ]
    )

    def __init__(
        self,
        model,
        nuztop=1,
        iuzfopt=0,
        irunflg=0,
        ietflg=0,
        ipakcb=None,
        iuzfcb2=None,
        ntrail2=10,
        nsets=20,
        surfdep=1.0,
        iuzfbnd=1,
        irunbnd=0,
        vks=1.0e-6,
        eps=3.5,
        thts=0.35,
        thtr=0.15,
        thti=0.20,
        specifythtr=False,
        specifythti=False,
        nosurfleak=False,
        finf=1.0e-8,
        pet=5.0e-8,
        extdp=15.0,
        extwc=0.1,
        air_entry=0.0,
        hroot=0.0,
        rootact=0.0,
        nwt_11_fmt=False,
        specifysurfk=False,
        rejectsurfk=False,
        seepsurfk=False,
        etsquare=None,
        netflux=None,
        capillaryuzet=False,
        nuzgag=None,
        uzgag=None,
        extension="uzf",
        unitnumber=None,
        filenames=None,
        options=None,
        surfk=0.1,
    ):

        # set default unit number of one is not specified
        if unitnumber is None:
            unitnumber = ModflowUzf1._defaultunit()

        # set filenames
        nlen = 3
        if uzgag is not None:
            nlen += len(uzgag)
        filenames = self._prepare_filenames(filenames, nlen)

        # update external file information with cbc output, if necessary
        if ipakcb is not None:
            model.add_output_file(
                abs(ipakcb), fname=filenames[1], package=self._ftype()
            )
        else:
            ipakcb = 0

        if iuzfcb2 is not None:
            model.add_output_file(
                abs(iuzfcb2),
                fname=filenames[2],
                extension="uzfcb2.bin",
                package=self._ftype(),
            )
        else:
            iuzfcb2 = 0

        ipos = 3
        if uzgag is not None:
            # convert to dict
            if isinstance(uzgag, list):
                d = {}
                for l in uzgag:
                    if len(l) > 1:
                        d[l[2]] = [l[0], l[1], l[3]]
                    else:
                        d[-np.abs(l[0])] = []
                uzgag = d
            for key, value in uzgag.items():
                iu = abs(key)
                model.add_output_file(
                    iu,
                    fname=filenames[ipos],
                    binflag=False,
                    extension=f"uzf{iu}.out",
                    package=self._ftype(),
                )
                ipos += 1
                # handle case where iftunit is listed in the values
                # (otherwise, iftunit will be written instead of iuzopt)
                if len(value) == 4:
                    uzgag[key] = value[:2] + value[-1:]
                elif len(value) == 1:
                    uzgag[-np.abs(key)] = []

        # call base package constructor
        super().__init__(
            model,
            extension=extension,
            name=self._ftype(),
            unit_number=unitnumber,
            filenames=filenames[0],
        )

        if (
            self.parent.get_package("RCH") is not None
            or self.parent.get_package("EVT") is not None
        ):
            print(
                "WARNING!\n The RCH and EVT packages should not be "
                "active when the UZF1 package is active!"
            )
        if self.parent.version == "mf2000":
            print(
                "WARNING!\nThe UZF1 package is only compatible "
                "with MODFLOW-2005 and MODFLOW-NWT!"
            )
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper

        self._generate_heading()
        self.url = "uzf_unsaturated_zone_flow_pack.htm"

        # Data Set 1a
        if nwt_11_fmt:
            warnings.warn(
                "nwt_11_fmt has been deprecated,"
                " and will be removed in the next release"
                " please provide a flopy.utils.OptionBlock object"
                " to the options argument",
                DeprecationWarning,
            )
        self.nwt_11_fmt = nwt_11_fmt
        self.specifythtr = bool(specifythtr)
        self.specifythti = bool(specifythti)
        self.nosurfleak = bool(nosurfleak)
        self.specifysurfk = bool(specifysurfk)
        self.rejectsurfk = bool(rejectsurfk)
        self.seepsurfk = bool(seepsurfk)
        self.capillaryuzet = bool(capillaryuzet)
        self.etsquare = False
        self.smoothfact = None
        if etsquare is not None:
            try:
                float(etsquare)
            except:
                print(
                    "etsquare must be specified by entering a real "
                    "number for smoothfact."
                )
            self.etsquare = True
            self.smoothfact = etsquare
        self.netflux = False
        self.unitrech = None
        self.unitdis = None
        if netflux is not None:
            e = "netflux must be a length=2 sequence of unitrech, unitdis"
            assert len(netflux) == 2, e
            self.netflux = True
            self.unitrech, self.unitdis = netflux

        if options is None:
            if (
                specifythti,
                specifythtr,
                nosurfleak,
                specifysurfk,
                rejectsurfk,
                seepsurfk,
                self.etsquare,
                self.netflux,
            ) != (False, False, False, False, False, False, False, False):
                options = OptionBlock("", ModflowUzf1, block=False)
                if "nwt" in self.parent.version:
                    options.block = True

        self.options = options

        # Data Set 1b
        # NUZTOP IUZFOPT IRUNFLG IETFLG ipakcb IUZFCB2 [NTRAIL2 NSETS2] NUZGAG SURFDEP
        self.nuztop = nuztop
        self.iuzfopt = iuzfopt
        # The Streamflow-Routing (SFR2) and(or) the Lake (LAK3) Packages
        # must be active if IRUNFLG is not zero.
        self.irunflg = irunflg
        self.ietflg = ietflg
        self.ipakcb = ipakcb
        self.iuzfcb2 = iuzfcb2
        if iuzfopt > 0:
            self.ntrail2 = ntrail2
            self.nsets = nsets
        self.surfdep = surfdep

        # Data Set 2
        # IUZFBND (NCOL, NROW) -- U2DINT
        self.iuzfbnd = Util2d(
            model, (nrow, ncol), np.int32, iuzfbnd, name="iuzfbnd"
        )

        # If IRUNFLG > 0: Read item 3
        # Data Set 3
        # [IRUNBND (NCOL, NROW)] -- U2DINT
        if irunflg > 0:
            self.irunbnd = Util2d(
                model, (nrow, ncol), np.int32, irunbnd, name="irunbnd"
            )

        # IF the absolute value of IUZFOPT = 1: Read item 4.
        # Data Set 4
        # [VKS (NCOL, NROW)] -- U2DREL
        if abs(iuzfopt) in [0, 1]:
            self.vks = Util2d(model, (nrow, ncol), np.float32, vks, name="vks")

        if seepsurfk or specifysurfk:
            self.surfk = Util2d(
                model, (nrow, ncol), np.float32, surfk, name="surfk"
            )

        if iuzfopt > 0:
            # Data Set 5
            # EPS (NCOL, NROW) -- U2DREL
            self.eps = Util2d(model, (nrow, ncol), np.float32, eps, name="eps")
            # Data Set 6a
            # THTS (NCOL, NROW) -- U2DREL
            self.thts = Util2d(
                model, (nrow, ncol), np.float32, thts, name="thts"
            )
            # Data Set 6b
            # THTS (NCOL, NROW) -- U2DREL
            if self.specifythtr > 0:
                self.thtr = Util2d(
                    model, (nrow, ncol), np.float32, thtr, name="thtr"
                )
            # Data Set 7
            # [THTI (NCOL, NROW)] -- U2DREL
            self.thti = Util2d(
                model, (nrow, ncol), np.float32, thti, name="thti"
            )

        # Data Set 8
        # {IFTUNIT: [IUZROW, IUZCOL, IUZOPT]}
        self._uzgag = uzgag

        # Dataset 9, 11, 13 and 15 will be written automatically in the
        # write_file function
        # Data Set 10
        # [FINF (NCOL, NROW)] – U2DREL

        self.finf = Transient2d(
            model, (nrow, ncol), np.float32, finf, name="finf"
        )
        if ietflg > 0:
            self.pet = Transient2d(
                model, (nrow, ncol), np.float32, pet, name="pet"
            )
            self.extdp = Transient2d(
                model, (nrow, ncol), np.float32, extdp, name="extdp"
            )
            self.extwc = Transient2d(
                model, (nrow, ncol), np.float32, extwc, name="extwc"
            )

        if capillaryuzet and "nwt" in model.version:
            self.air_entry = Transient2d(
                model, (nrow, ncol), np.float32, air_entry, name="air_entry"
            )
            self.hroot = Transient2d(
                model, (nrow, ncol), np.float32, hroot, name="hroot"
            )
            self.rootact = Transient2d(
                model, (nrow, ncol), np.float32, rootact, name="rootact"
            )

        self.parent.add_package(self)

    def __setattr__(self, key, value):
        if key == "uzgag":
            print(
                "Uzgag must be set by the constructor modifying this "
                "attribute requires creating a new ModflowUzf1 instance"
            )
        else:
            super().__setattr__(key, value)

    @property
    def nuzgag(self):
        """Number of uzf gages

        Returns
        -------
        nuzgag : int
            Number of uzf gages

        """
        if self.uzgag is None:
            return 0
        else:
            return len(self.uzgag)

    @property
    def uzgag(self):
        """Get the uzf gage data

        Returns
        -------
        uzgag : dict
            Dictionary containing uzf gage data for each gage

        """
        return self._uzgag

    def _2list(self, arg):
        # input as a 3D array
        if isinstance(arg, np.ndarray) and len(arg.shape) == 3:
            lst = [arg[per, :, :] for per in range(arg.shape[0])]
        # input is not a 3D array, and not a list
        # (could be numeric value or 2D array)
        elif not isinstance(arg, list):
            lst = [arg]
        # input was already a list
        else:
            lst = arg
        return lst

    def _ncells(self):
        """Maximum number of cells that have uzf (developed for
        MT3DMS SSM package).

        Returns
        -------
        ncells: int
            maximum number of uzf cells

        """
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        return nrow * ncol

    def _write_1a(self, f_uzf):

        # the nwt_11_fmt code is slated for removal (deprecated!)
        if not self.nwt_11_fmt:
            specify_temp = ""
            if self.specifythtr > 0:
                specify_temp += "SPECIFYTHTR "
            if self.specifythti > 0:
                specify_temp += "SPECIFYTHTI "
            if self.nosurfleak > 0:
                specify_temp += "NOSURFLEAK"
            if (self.specifythtr + self.specifythti + self.nosurfleak) > 0:
                f_uzf.write(f"{specify_temp}\n")
            del specify_temp
        else:
            txt = "options\n"
            for var in [
                "specifythtr",
                "specifythti",
                "nosurfleak",
                "specifysurfk",
                "rejectsurfk",
                "seepsurfk",
            ]:
                value = self.__dict__[var]
                if int(value) > 0:
                    txt += f"{var}\n"
            if self.etsquare:
                txt += f"etsquare {self.smoothfact}\n"
            if self.netflux:
                txt += f"netflux {self.unitrech} {self.unitdis}\n"
            txt += "end\n"
            f_uzf.write(txt)

    def write_file(self, f=None):
        """
        Write the package file.

        Returns
        -------
        None

        """
        nrow, ncol, nlay, nper = self.parent.nrow_ncol_nlay_nper
        # Open file for writing
        if f is not None:
            if isinstance(f, str):
                f_uzf = open(f, "w")
            else:
                f_uzf = f
        else:
            f_uzf = open(self.fn_path, "w")
        f_uzf.write(f"{self.heading}\n")

        # Dataset 1a
        if (
            isinstance(self.options, OptionBlock)
            and self.parent.version == "mfnwt"
        ):
            self.options.update_from_package(self)
            self.options.write_options(f_uzf)

        else:
            self._write_1a(f_uzf)

        # Dataset 1b
        if self.iuzfopt > 0:
            comment = " #NUZTOP IUZFOPT IRUNFLG IETFLG ipakcb IUZFCB2 NTRAIL NSETS NUZGAGES"
            f_uzf.write(
                "{0:10d}{1:10d}{2:10d}{3:10d}{4:10d}{5:10d}{6:10d}{7:10d}{8:10d}{9:15.6E}{10:100s}\n".format(
                    self.nuztop,
                    self.iuzfopt,
                    self.irunflg,
                    self.ietflg,
                    self.ipakcb,
                    self.iuzfcb2,
                    self.ntrail2,
                    self.nsets,
                    self.nuzgag,
                    self.surfdep,
                    comment,
                )
            )
        else:
            comment = " #NUZTOP IUZFOPT IRUNFLG IETFLG ipakcb IUZFCB2 NUZGAGES"
            f_uzf.write(
                "{0:10d}{1:10d}{2:10d}{3:10d}{4:10d}{5:10d}{6:10d}{7:15.6E}{8:100s}\n".format(
                    self.nuztop,
                    self.iuzfopt,
                    self.irunflg,
                    self.ietflg,
                    self.ipakcb,
                    self.iuzfcb2,
                    self.nuzgag,
                    self.surfdep,
                    comment,
                )
            )
        f_uzf.write(self.iuzfbnd.get_file_entry())
        if self.irunflg > 0:
            f_uzf.write(self.irunbnd.get_file_entry())
        # IF the absolute value of IUZFOPT = 1: Read item 4.
        # Data Set 4
        # [VKS (NCOL, NROW)] -- U2DREL
        if abs(self.iuzfopt) in [0, 1]:
            f_uzf.write(self.vks.get_file_entry())

        # Dataset 4b modflow 2005 v. 1.12 and modflow-nwt v. 1.1
        if self.seepsurfk or self.specifysurfk:
            f_uzf.write(self.surfk.get_file_entry())

        if self.iuzfopt > 0:
            # Data Set 5
            # EPS (NCOL, NROW) -- U2DREL
            f_uzf.write(self.eps.get_file_entry())
            # Data Set 6a
            # THTS (NCOL, NROW) -- U2DREL
            f_uzf.write(self.thts.get_file_entry())
            # Data Set 6b
            # THTR (NCOL, NROW) -- U2DREL
            if self.specifythtr > 0.0:
                f_uzf.write(self.thtr.get_file_entry())
            # Data Set 7
            # [THTI (NCOL, NROW)] -- U2DREL
            if (
                not self.parent.get_package("DIS").steady[0]
                or self.specifythti > 0.0
            ):
                f_uzf.write(self.thti.get_file_entry())
        # If NUZGAG>0: Item 8 is repeated NUZGAG times
        # Data Set 8
        # [IUZROW] [IUZCOL] IFTUNIT [IUZOPT]
        if self.nuzgag > 0:
            for iftunit, values in self.uzgag.items():
                if iftunit > 0:
                    values[0] += 1
                    values[1] += 1
                    comment = " #IUZROW IUZCOL IFTUNIT IUZOPT"
                    values.insert(2, iftunit)
                    for v in values:
                        f_uzf.write(f"{v:10d}")
                    f_uzf.write(f"{comment}\n")
                else:
                    comment = " #IFTUNIT"
                    f_uzf.write(f"{iftunit:10d}")
                    f_uzf.write(f"{comment}\n")

        def write_transient(name):
            invar, var = self.__dict__[name].get_kper_entry(n)

            comment = f" #{name} for stress period {n + 1}"
            f_uzf.write(f"{invar:10d}{comment:20s}\n")
            if invar >= 0:
                f_uzf.write(var)

        for n in range(nper):
            write_transient("finf")
            if self.ietflg > 0:
                write_transient("pet")
                write_transient("extdp")
                if self.iuzfopt > 0:
                    write_transient("extwc")
            if self.capillaryuzet and "nwt" in self.parent.version:
                write_transient("air_entry")
                write_transient("hroot")
                write_transient("rootact")

        f_uzf.close()

    @classmethod
    def load(cls, f, model, ext_unit_dict=None, check=False):
        """
        Load an existing package.

        Parameters
        ----------
        f : filename or file handle
            File to load.
        model : model object
            The model object (of type :class:`flopy.modflow.mf.Modflow`) to
            which this package will be added.
        ext_unit_dict : dictionary, optional
            If the arrays in the file are specified using EXTERNAL,
            or older style array control records, then `f` should be a file
            handle.  In this case ext_unit_dict is required, which can be
            constructed using the function
            :class:`flopy.utils.mfreadnam.parsenamefile`.

        Returns
        -------
        uzf : ModflowUZF1 object
            ModflowUZF1 object.

        Examples
        --------

        >>> import flopy
        >>> m = flopy.modflow.Modflow()
        >>> uzf = flopy.modflow.ModflowUZF1.load('test.uzf', m)

        """
        if model.verbose:
            print("loading uzf package file...")

        openfile = not hasattr(f, "read")
        if openfile:
            filename = f
            f = open(filename, "r")

        # dataset 0 -- header
        while True:
            line = f.readline()
            if line[0] != "#":
                break
        # determine problem dimensions
        nrow, ncol, nlay, nper = model.get_nrow_ncol_nlay_nper()

        # dataset 1a
        specifythtr = False
        specifythti = False
        nosurfleak = False
        specifysurfk = False
        capillaryuzet = False
        etsquare = None
        netflux = None
        rejectsurfk = False
        seepsurfk = False
        options = None
        if model.version == "mfnwt" and "options" in line.lower():
            options = OptionBlock.load_options(f, ModflowUzf1)
            line = multi_line_strip(f)

        else:
            query = (
                "specifythtr",
                "specifythti",
                "nosurfleak",
                "specifysurfk",
                "rejectsurfk",
                "seepsurfk",
                "etsquare",
                "netflux",
                "savefinf",
            )
            for i in query:
                if i in line.lower():
                    options = OptionBlock(
                        line.lower().strip(), ModflowUzf1, block=False
                    )
                    line = multi_line_strip(f)
                    break

        if options is not None:
            specifythtr = options.specifythtr
            specifythti = options.specifythti
            nosurfleak = options.nosurfleak
            rejectsurfk = options.rejectsurfk
            seepsurfk = options.seepsurfk
            specifysurfk = options.specifysurfk
            capillaryuzet = options.capillaryuzet

            if options.etsquare:
                etsquare = options.smoothfact
            if options.netflux:
                netflux = [options.unitrech, options.unitdis]

        # dataset 1b
        (
            nuztop,
            iuzfopt,
            irunflg,
            ietflg,
            ipakcb,
            iuzfcb2,
            ntrail2,
            nsets2,
            nuzgag,
            surfdep,
        ) = _parse1(line)

        arrays = {
            "finf": {},
            # datasets 10, 12, 14, 16 are lists of util2d arrays
            "pet": {},
            "extdp": {},
            "extwc": {},
            "air_entry": {},
            "hroot": {},
            "rootact": {},
        }

        def load_util2d(name, dtype, per=None):
            print(f"   loading {name} array...")
            if per is not None:
                arrays[name][per] = Util2d.load(
                    f, model, (nrow, ncol), dtype, name, ext_unit_dict
                )
            else:
                arrays[name] = Util2d.load(
                    f, model, (nrow, ncol), dtype, name, ext_unit_dict
                )

        # dataset 2
        load_util2d("iuzfbnd", np.int32)

        # dataset 3
        if irunflg > 0:
            load_util2d("irunbnd", np.int32)

        # dataset 4
        if iuzfopt in [0, 1]:
            load_util2d("vks", np.float32)

        # dataset 4b
        if seepsurfk or specifysurfk:
            load_util2d("surfk", np.float32)

        if iuzfopt > 0:
            # dataset 5
            load_util2d("eps", np.float32)

            # dataset 6
            load_util2d("thts", np.float32)

            if specifythtr:
                # dataset 6b (residual water content)
                load_util2d("thtr", np.float32)

            if specifythti or np.all(~model.dis.steady.array):
                # dataset 7 (initial water content;
                #            only read if not steady-state)
                load_util2d("thti", np.float32)

        # dataset 8
        uzgag = {}
        if nuzgag > 0:
            for i in range(nuzgag):
                iuzrow, iuzcol, iftunit, iuzopt = _parse8(f.readline())
                tmp = [iuzrow, iuzcol] if iftunit > 0 else []
                tmp.append(iftunit)
                if iuzopt > 0:
                    tmp.append(iuzopt)
                uzgag[iftunit] = tmp

        # dataset 9
        for per in range(nper):
            print(f"stress period {per + 1}:")
            line = line_parse(f.readline())
            nuzf1 = pop_item(line, int)

            # dataset 10
            if nuzf1 >= 0:
                load_util2d("finf", np.float32, per=per)

            if ietflg > 0:
                # dataset 11
                line = line_parse(f.readline())
                nuzf2 = pop_item(line, int)
                if nuzf2 >= 0:
                    # dataset 12
                    load_util2d("pet", np.float32, per=per)
                # dataset 13
                line = line_parse(f.readline())
                nuzf3 = pop_item(line, int)
                if nuzf3 >= 0:
                    # dataset 14
                    load_util2d("extdp", np.float32, per=per)
                # dataset 15
                line = line_parse(f.readline())
                nuzf4 = pop_item(line, int)
                if nuzf4 >= 0:
                    # dataset 16
                    load_util2d("extwc", np.float32, per=per)

                if capillaryuzet:
                    # dataset 17
                    line = line_parse(f.readline())
                    nuzf5 = pop_item(line, int)
                    if nuzf5 > 0:
                        # dataset 18
                        load_util2d("air_entry", np.float32, per=per)

                    # dataset 19
                    line = line_parse(f.readline())
                    nuzf6 = pop_item(line, int)
                    if nuzf6 > 0:
                        # dataset 20
                        load_util2d("hroot", np.float32, per=per)

                    # dataset21
                    line = line_parse(f.readline())
                    nuzf7 = pop_item(line, int)
                    if nuzf7 > 0:
                        # dataset 22
                        load_util2d("rootact", np.float32, per=per)

        # close the file
        f.close()

        # determine specified unit number
        unitnumber = None
        filenames = [None for x in range(3 + nuzgag)]
        if ext_unit_dict is not None:
            unitnumber, filenames[0] = model.get_ext_dict_attr(
                ext_unit_dict, filetype=ModflowUzf1._ftype()
            )
            if abs(ipakcb) > 0:
                iu, filenames[1] = model.get_ext_dict_attr(
                    ext_unit_dict, unit=abs(ipakcb)
                )
                model.add_pop_key_list(ipakcb)
            if abs(iuzfcb2) > 0:
                iu, filenames[2] = model.get_ext_dict_attr(
                    ext_unit_dict, unit=abs(iuzfcb2)
                )
                model.add_pop_key_list(abs(iuzfcb2))

            ipos = 3
            if nuzgag > 0:
                for key, value in uzgag.items():
                    iu, filenames[ipos] = model.get_ext_dict_attr(
                        ext_unit_dict, unit=abs(key)
                    )
                    model.add_pop_key_list(abs(iu))
                    ipos += 1

        # create uzf object
        return cls(
            model,
            nuztop=nuztop,
            iuzfopt=iuzfopt,
            irunflg=irunflg,
            ietflg=ietflg,
            ipakcb=ipakcb,
            iuzfcb2=iuzfcb2,
            ntrail2=ntrail2,
            nsets=nsets2,
            surfdep=surfdep,
            uzgag=uzgag,
            specifythtr=specifythtr,
            specifythti=specifythti,
            nosurfleak=nosurfleak,
            etsquare=etsquare,
            netflux=netflux,
            seepsurfk=seepsurfk,
            specifysurfk=specifysurfk,
            rejectsurfk=rejectsurfk,
            capillaryuzet=capillaryuzet,
            unitnumber=unitnumber,
            filenames=filenames,
            options=options,
            **arrays,
        )

    @staticmethod
    def _ftype():
        return "UZF"

    @staticmethod
    def _defaultunit():
        return 19

def _parse1a(line):
    line = line_parse(line)
    line = [s.lower() if isinstance(s, str) else s for s in line]
    specifythtr = True if "specifythtr" in line else False
    specifythti = True if "specifythti" in line else False
    nosurfleak = True if "nosurfleak" in line else False
    return specifythtr, specifythti, nosurfleak

def _parse1(line):
    ntrail2 = None
    nsets2 = None
    line = line_parse(line)
    nuztop = pop_item(line, int)
    iuzfopt = pop_item(line, int)
    irunflg = pop_item(line, int)
    ietflag = pop_item(line, int)
    ipakcb = pop_item(line, int)
    iuzfcb2 = pop_item(line, int)
    if iuzfopt > 0:
        ntrail2 = pop_item(line, int)
        nsets2 = pop_item(line, int)
    nuzgag = pop_item(line, int)
    surfdep = pop_item(line, float)
    return (
        nuztop,
        iuzfopt,
        irunflg,
        ietflag,
        ipakcb,
        iuzfcb2,
        ntrail2,
        nsets2,
        nuzgag,
        surfdep,
    )

def _parse8(line):
    iuzrow = None
    iuzcol = None
    iuzopt = 0
    line = line_parse(line)
    if (len(line) > 1 and not int(line[0]) < 0) or (
        len(line) > 1 and line[1].isdigit()
    ):
        iuzrow = pop_item(line, int) - 1
        iuzcol = pop_item(line, int) - 1
        iftunit = pop_item(line, int)
        iuzopt = pop_item(line, int)
    else:
        iftunit = pop_item(line, int)
    return iuzrow, iuzcol, iftunit, iuzopt

redpajama_set_name: RedPajamaGithub


text:
Stanton House Hotel to undergo £2m renovation under new ownership
DESIGNINDUSTRYOWNERS & OPERATORS by Zoe Monk	on March 2, 2021
Stanton House Hotel in Wiltshire has been sold to new owner, John Mulchandani, to be now operated by Meridian Hotels.
The Cotswolds stone manor house, home to 78 bedrooms and set in 11 acres, will now undergo a £2m renovation to bring the property 'back to its former glory' having been owned by Japanese automotive manufacturer, Honda for the last 30 years.
Stanton House Hotel went on the market in October 2020 under joint instruction by Knight Frank and Colliers International with an asking price of £5.95m.
It is thought this price was reduced by £1m before being sold to Mulchandani.
The main manor building was re-constructed in the 1930s and is linked to the 1990s bedroom block extension by a two-storey section.
As well as lounge and bar areas on the first floor and the conservatory, the manor house has three function rooms.
It previously accommodated many people working for Honda who came to Swindon from Japan, and as a result the hotel boasts a Japanese restaurant, bilingual signs, Japanese TV programmes and Japanese groceries.
Matthew Smith, partner in the hotels team at Knight Frank, commented: "This is the second hotel we have sold to John Mulchandani, having purchased The Holiday Inn Sittingbourne in Kent through Knight Frank in 2019. Meridian Hotels have been appointed to operate the hotel and under their management along with the future investment plans for Stanton House Hotel the business will no doubt be a huge success. Despite the ongoing lockdown restrictions interest in Stanton House was strong given its proximity to the Cotswolds, making it an ideal asset for the burgeoning staycation sector."
Paul Evans, operations director Meridian Hotels, commented: "We are very pleased with this acquisition and will continue with the 'Stanton House Hotel' name and its current use as a hotel. The property needs substantial investment and an estimated £2m has been set aside to bring the business and property back to its former glory, with a complete makeover carried out with sensitivity and care."
Tags : hotelssoldStanton House Hotel
The Vineyard looks to capitalise on outdoor dining with launch of new F&B concept
The Salutation Hotel goes on the market for £5m a year after insolvency
The author Zoe Monk
Importance of sustainable, inclusive businesses to be discussed at Hotel Leadership Conference
Meldrum House Country Hotel launch largest domed drinks bar in the UK
Why Ingleside House is 'not just another Cotswold hotel'
Sustainability and inclusion key to easing hospitality recruitment crisis
Shortage of Kent hotels offers 'valuable opportunity' for developers
New UK hotels 2022: The openings set to shake up the market
New boutique hotel Boys Hall to open in Kent this summer
Portrush seaside hotel to reopen under new guise after renovation from new owners
First Look: Design of The Retreat at Elcot Park revealed
Hollywood star Samuel L. Jackson's surprise stay at Manor House hotel in Huddersfield

redpajama_set_name: RedPajamaCommonCrawl


text:
'Sh*t's Crazy, Dude!' Chilling Secret Recordings of Teen Murder Supect Played in Court
Aaron KellerMay 3rd, 2018, 3:55 pm
Jurors in the trial of a teen football player accused of killing his cheerleader ex-girlfriend heard a series of chilling secret recordings of the defendant in court Thursday afternoon.
William Riley Gaul, 18, is accused of killing Emma Walker, 16, after their rocky relationship ultimately resulted in her ignoring his attempts to get her attention, prosecutors say.
In the recordings, Gaul is heard discussing a police interrogation: "They don't know anything. If they did, I would be in jail right now," he told his friends who made the recordings.
Gaul's friends recorded him after he fired two bullets at Walker's house from a position outside. One of the bullets became stuck in the wall. The other entered the wall and struck Walker in the head, killing her instantly as she slept. At trial, the defense admitted Gaul was the triggerman, but disputed his intent. Prosecutors said he committed premeditated, intentional murder. The defense said it was another in a bizarre set of events where Gaul would place himself in danger, then seek Walker's sympathy, or where Gaul would place Walker in danger and then seek to ride in to rescue or comfort her. Gaul already admitted to a reckless conduct charge for firing into the occupied Walker house.
A different story emerged, however, as the friends, who were working with the police, surreptitiously recorded Riley Gaul the night he almost disposed of the gun. Gaul told his friends that if they were confronted by the police, they should say they were drunk, high, or in an otherwise altered state of mind. That way, he presumed, the authorities wouldn't be able to rely on any comments the friends made.
Gaul also told his friends that the police told him a bullet recovered from the scene had his grandfather's fingerprint on it. The gun Gaul used was stolen from his grandfather's car on a day when Gaul had access to it, the state said. Gaul assumed detectives were lying to him because he assumed his grandfather would have been arrested if that fact about the fingerprint was true, he rationalized.
In the videos, Gaul told his friends the police had interrogated him for two and a half hours. He also suggested Walker killed herself.
"Lots of people are saying she shot herself because of me," he said. One of his friends is heard asking, "She didn't kill herself?" Gaul responded, "She did! No one knows that but me and [my] parents."
Gaul also claimed to his friends Walker called him and said someone dressed in black was trying to get into her house.
His friends started referring to the situation as "crazy." Gaul said, "I can't believe I'm in trouble for a murder I didn't commit. I couldn't even go to her candlelight vigil." He added, "I couldn't even bring myself to murder someone."
Gaul was worried about Walker's parents not hearing the 3 a.m. gunshot.
"The ambulance wasn't even there until the next morning . . . say someone shot her in the wall and hit her in the stomach . . . she's going to wake up from that," Gaul said.
The bullet had actually penetrated the wall and struck Walker in the head, killing her instantly in her sleep, prosecutors have said.
Gaul further worried about what police would find when they searched his phone. He told his friends that at one point, Walker was texting him that there was a "guy inside" her house and "a stranger trying to get in." He claimed he was outside, but that she had yelled at him through a window and told him to get away. Gaul said he was just trying to help Walker.
The friends continued recording Gaul as they proceeded together to a location where Gaul wanted to throw the gun into the Tennessee river. The friends had alerted police, who were waiting.
Throughout the videos, Gaul appeared unaware he was being recorded.
[Image via the Law&Crime Network.]
TennesseeWilliam Riley Gaul


text:
Melissa McCarthy and Nicole Kidman Are Working on a New Show by the Big Little Lies Creator
Melissa McCarthy will grace our TV screens once again.
The 49-year-old Emmy winner is set to star alongside Nicole Kidman in Nine Perfect Strangers, a Hulu limited series based on Big Little Lies author Liane Moriarty's 2018 book, Deadline reported.
Nine Perfect Strangers takes place at a boutique wellness resort that promises to create happier, healthier lives for nine stressed city dwellers. McCarthy will play Francis, a middle-aged novelist recovering from a career crash. Kidman, 52, plays Masha, the resort's tireless director.
RELATED: Nicole Kidman & Keith Urban Donate $500,000 to Australian Fire Relief as Their House 'Is Under Threat'
The series is expected to premiere on Hulu in 2021.
MediaPunch/Shutterstock; John Shearer/WireImage
McCarthy has not been a series regular on TV since her CBS comedy Mike & Molly finished in 2016. Her leading role and guest appearances on Saturday Night Live earned the comedian several Emmy nominations.
She will also host her first season of the NBC kids' talent show Little Big Shots this year.
Nine Perfect Strangers reunites some of the key players behind popular drama series (also based on a Moriarty book!). Big Little Lies star and executive producer Kidman, writer and co-show-runner David E. Kelley and executive producer Bruna Papandrea are all returning for the new series.
RELATED: 'We Are Obvious Soulmates': Everything the Big Little Lies Stars Have Said About One Another
McCarthy will also join as an executive producer.
Hopefully, the show will satisfy the appetites of Big Little Lies' fans after season 2 concluded in July, with no return on the horizon.
Aerosmith responds to lawsuit from drummer Joey Kramer: 'He's our brother'
Surprise! Meghan Markle Secretly Visited Her Animal Charity Patronage While in London
Mom Who Died Just Days After Giving Birth Becomes 1 in a Million Organ Donor, Fulfilling Dying Wish
Behind Brad Pitt and Jennifer Aniston's 'Touching' SAG Moment: The Photographer Reveals Details
Fed-Up John Roberts Delivers A Stark Warning To Both Sides Of Impeachment
Tim G: "Roberts told both sides to "remember that they are addressing the world's greatest deliberative body" I'm sorry, Chief Justice Roberts, but Congress has NOT been "the world's greatest deliberative body" in decades. This is why we NEED term limits....
Former Recording Academy Chief Neil Portnow Accused of Raping Female Recording Artist
Amanda Knox Wears Her Old 'Prison Uniform' While Preparing for Her Upcoming Wedding


text:
You are here: Home News News and features Universities team up to teach a new frontier in medical science
Universities team up to teach a new frontier in medical science
Genomics has been touted as the future of medical treatment and it will allow health specialists to create individual treatment plans for patients based on their unique needs.
Now a new course for postgraduate students has been launched by nine leading universities.
The Genomic Medicine Masters' programme has been designed by Health Education England and is especially suitable for doctors, healthcare professionals and students with an interest in genetics and genomics.
Dr Kate Everett, Senior Lecturer in Human Genetics, at St George's, University of London, said: "We are extremely proud and excited to be teaching the Genomic Medicine programme.
"We have successfully educated more than 80 NHS staff members in the first three years of the programme and hope to reach many more in the next three to five years.
"In particular, we are keen to encourage staff to consider bespoke sets of modules to suit their areas of interest which will contribute to postgraduate qualifications."
The St George's course will be jointly run in South London with King's College London so students will benefit from the breadth of expertise provided by both institutions which are linked to major teaching hospitals.
Dr Francesca Capon, Senior Lecturer at the School of Basic and Medical Biosciences, King's College London, said: "We are looking forward to teaching on the renewed programme.
"As the advances of the 100,000 Genome projects are poised to transform the diagnosis of genetic disorders and cancer, we will be offering a variety of flexible learning opportunities to the NHS work force and to graduates who have an interest in this fast moving field."
There are approximately 25 places available for the September 2018 start of course which lasts either one year full time or two years part time and covers technological advances which have transformed how genomic data is generated, analysed and presented.
The course has been designed to support the transformation of the NHS as it implements the Genomic Medicine Service later this year, which takes forward the legacy of the 100,000 Genomes Project and the work of the NHS England Genomic Medicine Centres.
Both institutions are ranked among the top 200 universities in the world according to the recent Times Higher Education World University Rankings.
In all nine universities have been awarded contracts to deliver Health Education England's Master's programme in Genomic Medicine from autumn 2018 for a minimum of three years following the first successful iteration of this funded programme that began in 2015.
Other universities involved are: Imperial College London, Queen Mary University of London, University of Birmingham, University of Cambridge, University of Exeter and University of Manchester together with the University of Liverpool.
David Farrelly, Health Education England regional director and executive sponsor of HEE's Genomics Education Programme (GEP), said: "Health Education England exists to support the delivery of excellent healthcare by ensuring that the workforce of today and tomorrow has the right knowledge, skills, values and behaviours.
"Genomics is a key part of that mandate, and this innovative multi-professional Master's programme will help to ensure that the NHS is equipped to harness the potential of genomics for the benefit of patients."


text:
Q: Adding border to button makes it smaller When I add border to my button, the button shrinks in size. I am using the following line to add the border:
jButton.setBorder(BorderFactory.createLineBorder(Color.RED));

This is my button without border:

This is my button with border:

A: If you want to add a border, and also want a margin between the label text and the edge of the border, create a compound border, with an empty border on the inside (with the proper size fot the margin) and do n ot set the preferred size. This will allow the button to size itself properly regardless of the text and font of the label. For example:
LineBorder border1 = new LineBorder(Color.red);
EmptyBorder border2 = new EmptyBorder(1,5,1,5);
Border newBorder = BorderFactory.createCompoundBorder(border1, border2);

A: A quick a dirty example of why setPreferredSize is a terrible idea and why you should avoid it as much as possible.
You can also have a look at Should I avoid the use of set(Preferred|Maximum|Minimum)Size methods in Java Swing? for more of discussion on the subject

import java.awt.Color;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;

public class Test {

    public static void main(String[] args) {
        new Test();
    }

    public Test() {
        EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                try {
                    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
                    ex.printStackTrace();
                }

                JFrame frame = new JFrame("Testing");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.add(new TestPane());
                frame.pack();
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
            }
        });
    }

    public class TestPane extends JPanel {

        public TestPane() {
            JButton goodButton = new JButton("Location 1");
            Insets insets = goodButton.getInsets();
            goodButton.setBorder(new CompoundBorder(
                            new LineBorder(Color.RED),
                            new EmptyBorder(insets)));
            setLayout(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.gridwidth = GridBagConstraints.REMAINDER;
            gbc.insets = new Insets(8, 8, 8, 8);
            add(goodButton, gbc);

            JButton badButton = new JButton("Location 2");
            badButton.setPreferredSize(new Dimension(110, 29));
            badButton.setBorder(new LineBorder(Color.RED));
            add(badButton, gbc);

            ActionListener listener = new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    goodButton.setText(random());
                    badButton.setText(random());

                    float size = rnd.nextInt(48) + 12;

                    Font f = goodButton.getFont().deriveFont(size);
                    goodButton.setFont(f);
                    badButton.setFont(f);
                }
            };

            goodButton.addActionListener(listener);
            badButton.addActionListener(listener);
        }

        private Random rnd = new Random();

        protected String random() {
            int length = rnd.nextInt(15) + 5;
            StringBuilder sb = new StringBuilder(length);
            for (int index = 0; index < length; index++) {
                sb.append((char)('A' + rnd.nextInt(26)));
            }
            return sb.toString();
        }

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(600, 600);
        }

    }

}

This is some what of an exaggerated example, but I was, unfortunate enough, to inherit a project where the previous developer use setPreferredSize and while it worked "ok" on same PCs running the same OS, we had countless, seemingly random issues and many more and don't even get me started on what it did on MacOS.

But I'm only developing for Windows

Big deal, as I said, we had the app working "ok" on some Windows PCs, but as soon as some one had custom DPIs or font metrics or they upgraded to new version of Windows, it began to fall apart - Short answer - don't use setPreferredSize

A: Define width and height as per your need and implement the following line of code:
jButton.setPreferredSize(new Dimension(width, height));

redpajama_set_name: RedPajamaStackExchange


Next month (January 2015) will be the anniversary of my youngest brother's suicide. He took his life serving as a Jehovah's Witness missionary in the Dominican Republic.
He was married and was an active elder in his congregation. He had been brought up as one of Jehovah's Witnesses. His life was for his religion – all 36 years. The effort he put in spreading the message took great courage & time. He held firm to his beliefs, even shunning his mother & father, after they were disfellowshipped.
I can't be bothered with painting a picture of Jehovah's Witnesses and what they preach, whether it is good or bad. All I know is that I will be with my mother giving her some comfort in this terrible time trying to help with the loss of her son, my brother.
Throughout this year we wanted answers to his suicide & how he took his life. Working closely with the home office, we eventually got the news. It was another blow to the family: he had become very depressed.
He must have slipped through the net!
I can't believe that not a single member of this so called religion ever picked up on his depression. Nor was a single member sorry for his suicide. Maybe they were too busy dealing with someone smoking or reading bad literature?
We never heard from nor have we been contacted by the elders in his congregation nor by a member of the Governing Body just to say "Sorry for your loss". It is as if he never existed.
Therefore, this is my point: I will not believe that they share love. It is all hot air. They offered no comfort or support to an elderly mother who lost her son doing the things she showed him and encouraged him to do.
Now my mother is on a guilt trip. If she never introduced him to Jehovah's Witnesses all those years ago, would he still be alive today?
Please like my story as my mother will draw comfort knowing there are decent folk out there.
User is no longer on facebook.Lee Holmes (Article originally posted on Facebook: Dec 28 2014).
I'm so sorry for your family's loss. The WT has no sense of decency, not even sending condolences to your mum. They have no conscience, no human feeling towards the people who dedicate their lives to them, just use them up and forget about them. they are users and abusers!
They're going to the Lake of Fire because of shunning (1 John 3:15 and 1 John 4:20-21) and being false prophets. Rev 21:8.
This is indeed sad considering we are supposed to have intense love for one another.I am exjw and anointed sister accused apostate and Jehovah's daughter, i know too well the WTBTS are missing the mark..May Jehovah himself see and comfort you and your mom, for i know Jesus will do His part to send you the spirit of Peace, Agape my dear real friends. Yours in the Christ.
There was no missionary with this name in the Dominican Republic.


text:
Бенджамин Вальями (; 1747—1811) — часовщик, ответственный за конструирование механических часов, согласно которым в 1780—1884 годах официально сверялось время в Лондоне.

Биография

Бенджамин был сыном Джастина Вальями (Justin Vulliamy), часовщика швейцарского происхождения, который переехал в Лондон около 1730 года. Джастин стал партнёром Бенджамина Грея (Benjamin Gray), известного часовщика с улицы Пэл-Мэл, на дочери которого, Мэри Грей, он вскоре женился и имел от неё сына Бенджамина. Джастин унаследовал бизнес своего тестя и с 1780 его сын Бенджамин вошёл в объединение «Vulliamy & Son». Отец и сын работали вместе до самой смерти Джастина 1 декабря 1797 года.

С раннего возраста Вальями высказывал интерес к развитию родительского дела. Ещё подростком он создавал репутацию создателя декоративных и каминных часов, которые украшали имения представителей высшего круга общества (некоторые из них сейчас можно увидеть в Музее и художественной галерее Дерби). Его талант позволил ему получить назначение на должность королевского часовщика (King's Clockmaker, ранее этот титул носил Джордж Линсдей, George Lindsay) Георга III, на которой он получал ежегодную плату в 150 фунтов. Король, будучи любителем часовых и других механических устройств, был патроном Джастина Вальями, но только Бенджамин удостоился столь почётного звания.

Около 1780 года Вальями было поручено сконструировать главные механические часы для Королевской обсерватории в Кью, который служил нулевым меридианом и был ответственен за официальное лондонское время до 1884 года, после чего Гринвич взял на себя обе эти функции.

В 1780 году родился Бенджамин Льюис Вальями; он был последним из Вальями, посвяившим свою жизнь часовому семейному бизнесу. Никто из дальнейших потомков Бенджамина не работал на этом поприще, хотя его внук, Льюис Вальями, был выдающимся архитектором.

Часы Вальями
Часы Вальями имели чрезвычайную ценность и представляли вершину технологий того времени. Эти часы представлялись китайскому императору во время дипломатической миссии 1793 году Джорджа Макартни в Пекин. Изготовленные хранометры Б. Вальями сочетал с оформлением фарфоровыми фигурами, символизируя единство науки и искусства. Общий дизайн всегда создавался Вальями, но также он приглашал выдающихся скульпторов — например, Джона Дире (John Deare), которые непосредственно создавали надлежащие фигуры, не без влияния французских канонов тех времён в этой области искусства. Семья Вальями пользовалась услугами Royal Crown Derby для изготовления фарфоровых фигур. Кроме того, они отдавали работы на субподряд квалифицированным механикам, и зачастую лишь контролировали и вносили финальные коррективы в работу.

Примечания

Часовщики

redpajama_set_name: RedPajamaWikipedia


Please note that the eligibility criteria specified herein are the basic criteria for applying for the post. Candidates must necessarily produce the relevant documents pertaining to category, nationality, age, educational qualifications etc. in original along with a photocopy thereof in support of their identity and eligibility as indicated in the online application form. Please note that no change of category will be permitted at any stage after registration of the online application and the result will be processed considering the category which has been indicated in the online application, subject to guidelines of the Government of India in this regard. Merely applying for Online test/ appearing for and being shortlisted in the Online test and/or in the subsequent Interview/ document verification and subsequent processes does not imply that a candidate is empanelled for appointment in CWC. Final merit list for appointment will be prepared based on number of vacancies and marks secured in Online Test and Interview (wherever applicable) subject to qualifying / document verification process; as the case may be. No request for considering the candidature under any category other than in which applied will be entertained.
HOW TO APPLY : Candidates can apply online only from 15.02.2019 to 16.03.2019 and no other mode of application will be accepted. Pre-Requisites for Applying Online Before applying online, candidates should. Candidates are first required to go to the CWC's website www.cewacor.nic.in and click on the link 'Vacancy and Results' and then click on the option "CLICK HERE TO APPLY ONLINE FOR ADVERTISEMENT NO. 2019/01" to open the On-Line Application Form.
Online Examination (Tentative dates)- some/ all/ additional dates as the need arises April / May.


Posiva Oy, a company responsible for the final disposal of spent nuclear fuel of its owners, has today submitted the Environmental Impact Assessment programme to the Ministry of Employment and the Economy. The EIA procedure pertains to the extension of the final disposal facility of spent nuclear fuel under design in Olkiluoto by a volume of 3000 tons of uranium to accommodate a total of 12000 uranium tons of spent nuclear fuel instead of the previously designed 9000 uranium tons. With the planned extension of the final repository Posiva prepares for receiving spent nuclear fuel from the potential Loviisa 3 nuclear power plant unit of Fortum Power and Heat Oy.
Earlier this spring Posiva submitted to the Ministry of Employment and the Economy an application for a decision in principle on the extension of the final disposal facility to accommodate also spent nuclear fuel from the planned Olkiluoto 4 power plant unit of Teollisuuden Voima Oyj. This extension would increase the capacity of the final repository to 9000 uranium tons. An EIA procedure for this repository volume has been conducted already in the late 1990s in connection with the previous licencing procedure pertaining to the final disposal facility. An updated report of the environmental impact of the final disposal project required by the Ministry of Employment and the Economy was enclosed to the application for the decision in principle submitted in April.
The new plans for the extension of the final repository by a volume of further 3000 uranium tons requires a new EIA procedure. The starting point of the procedure is the final disposal solution based on the decisions in principle already issued and the previous EIA procedure.
The facility for final disposal of spent nuclear fuel consists of a part on the ground and underground. The extension of the facility concerns the underground repository to be built in the bedrock on the island of Olkiluoto. If the Loviisa 3 nuclear power plant unit is realised, the final disposal of spent nuclear fuel generated at the unit will start in the 2070s at the earliest.
As the contact authority for the project, the Ministry of Employment and the Economy will organise the publication of the EIA programme and will invite statements and opinions on the programme. The Ministry will also issue their own statement on the programme. The EIA report will then be drawn up on the basis of the programme and the statements issued on it. Posiva expects the EIA procedure to be completed by the beginning of 2009.
Posiva is currently constructing an underground characterisation facility called ONKALO in the bedrock of Olkiluoto. The information gathered from this facility will be utilised in the application for the construction licence of the final disposal facility, which will be submitted in 2012. At the moment, the underground tunnel runs over a length of three kilometres down to a depth of almost 300 metres. According to plans, the tunnel will reach the final disposal depth of ca. 400 metres in 2009. The final disposal of spent nuclear fuel is to start in 2020.


Re: A few photos from my New England 'Autumn Colors' trip.
Re: Show Us Your New SmugMug Customized Sites!
How does it look? I've been told the logo looks blurred so would be good to know if others feel the same...if it is blurred I'm not really sure what I'm doing wrong as the original png is very clear! (not that I'm bothered by the logo, it was only a 5 minute text job in photoshop!).
Yes, the logo does look a little blurry but not to an extent where it would be disturbing or otherwise would look bad. My guess is that it's because it has a transparent background, and those images have their issues.
As for your site design, I like it. It's clean, simple, logically structured and easy to navigate. Personally, I do not like to have the little house icon in the breadcrumb navigation displayed because the proportions to the text are way off, but that's just very subjective. Oh, and I also like your imagery work!
There is a slight blur to the logo. I may have not noticed it if you didn't bring my attention to it.
From here on, these are my opinions - you do what you want to do.
The location and other tags are distracting.
Since you state in your About page (which isn't one of the many links on the top of the page) you are into landscape, I suggest you make that a main Gallery. From the Landscape gallery you can divide up my location if that's important to you.
Personally I would prefer them to be organized by type first (shore, mountains, city, etc.) and then by location - only because I am not familiar with those locations. And if you tag them properly, potential buyers can find what they want.
I suggest you re-write, rearrange your about page - get to the point of the site first. If I'm interested, I'll read on. Knowing you also have a Flickr account with images that you decided not to bring to your portfolio site isn't important to me.
And speaking about the purpose and photos - I suggest you either push to sell your images (they are quite good) or remove a bunch of them because a casual visitor will be overwhelmed with the number of images. You could then use the excess images to fill out your Instagram account - that will help draw to your site. And if do decide to ramp up your IG activity - be consistent with what you post. Don't post cars, fish heads, and northern lights back to back. People who follow IG'ers do so for specific content.
Other Social - if you are not going to Tweet on a regular basis, remove the button from the site.
The Facebook link is broken - if you don't post regularly, remove the button.
There you have it - opinions from a random dude on the Internet.
Just some feedback for Winsome works. I have been trying different settings including having a passworded folder called Family with the password. The underlying galleries are set to public visibility. I've found that that works for preventing access to the underlying galleries in the Family folder as a password is required to get into any of the galleries.
However if you have a folder (and underlying galleries) with a password and then galleries within that folder with a different password, that doesn't seem to work. The passwords get confused. I found that when I have two passwords set up, it asks for the top password not the one attached to the sub folder or gallery. I have to spend time testing my passwords in this case.
I usually have my chrome browser open as well as Safari where I do all the smugmug changes. On the chrome browser I test the site in an unlogged on state to see how the passwords work. However once you have entered the password for a site, it is remembered for 24 hours I think, even if you are not the owner.
I think it's a matter of trying it out with two browsers open and getting friends to test out your links and ask them if they can get in. I also found the smugmug training session on Lynda.com helpful although it did not go into much detail on these security aspects. My local library has a free membership to Lynda.com to access the videos.
There does not appear to be a way to assign (or change) the date that a gallery was created? I'd like to create a sort of, newsfeed of galleries ordered by that date. Any ideas? Also, if there is a folder nested in a folder that contains images, it seems to only be placed at the beginning. No ability to sort.
I may not be completely understanding your issue, & maybe it's been solved adequately (until SmugMug changes something) for your needs. However, I just wanted to be sure you know you can also click & drag galleries & folders around within the Organizer. I mean, even if you have the order set to "Date Created - ascending", for instance, while you're looking at a gallery's contents in the Organizer, or a folder or sub-folder's contents, you can click on a photo's thumbnail, or a gallery's thumbnail, or a folder's thumbnail & drag it to the spot you want in your line-up. At that point, the order will re-set to "Manual Order" or something like that (I forget the exact wording). but when other galleries or folders are added, they'll continue to fall into the order they originally were going in, while still saving the manual changes.
Thanks for the response. Yes, I am aware of the ability to manually order a gallery. It is way too time-consuming, and error-prone, for my intended result. I've since moved away from using SmugMug for this purpose.
Re: Alberta landscapes, but need recommendations for a polarizer/landscape kit.
Hi, Kyle. I happen to use, on occasion, the very Tokina lens you have. A CP is a real staple in my shooting. When it comes to filters...any kind.... spend the most you can afford. I personally use both Nikon and B&W filters. There are a few good ones from other sources as well. Any time you put additional glass....filters....into the mix, you want the highest quality you can get your hands on. It's not an area you want to base your choice on pricing alone.
Good to know! Like I mentioned before I'm looking into getting a kit. I've seen some folks that have an attachment at the end of their lens where they can add multiple different filters. Do you know anything about those kits. I feel like it makes more sense to buy one of those kits where I'm not limited to only one option. For instance, what if I wanted to use a CP, but also a ND filter?
I bought one of those type of kits you're referring to. I think there are several variations of this concept around; mine was based on the Cokin system, but it could accommodate other manufacturer's filters. I didn't like using it. I found it to be somewhat of a pain to fool with. If I did only tripod work, I might feel a little different on that point. If I left the thing attached to the camera, and I was moving around a bit, it was just ungainly. And, if you're a stickler for the highest quality work you can put out there, I think the superior glass in the screw-in stuff is a far better option. Each option, though, has strong points.
My favorites of this set are the 6th photo and the last photo.
I would like to see the first photo with more space around it.


text:
Q: Timer Implementation not Running every 5 seconds as intended c# I have the following timer implementation. But the timer is not running every 5 seconds as needed. How can make this run every 5 seconds. At present its running about once in 30 seconds.
private void button1_Click(object sender, RoutedEventArgs e)
        {
            msgsent = 0;
            timer.Tick += timer_Tick;
            timer.Interval = new TimeSpan(0, 0, 5);
            bool isenable = timer.IsEnabled;
            timer.Start();
        }

private async void timer_Tick(object sender, object e)
        {
            if (geo == null)
            {
                geo = new Geolocator();
            }

            Geoposition posi = await geo.GetGeopositionAsync();

    if (posi.Coordinate.Point.Position.Latitude <= 12.9227 && posi.Coordinate.Point.Position.Longitude >= 080.1320)
                {
                    if (msgsent <=1)
                    {
                        msgsent = msgsent + 1;
                       ShowDialog(new MessageDialog("Your Bus has crossed xyz"));
                    }

                }

        }

A: I'll give you a hint.  If you understand where each goes, then it should be clear.  If not, you will once you get better.
// in the class definition
int msgsent;
Timer timer;

and
// in the constructor
timer = new Timer();
timer.Tick += timer_Tick;
timer.Interval = new TimeSpan(0, 0, 5);

and
// in the Button.Click event handler
timer.Start();

and
// in the Timer.Tick event handler
timer.Stop();
/* do your work here */
timer.Start();

There will be further issues when the user is clicking the button while you're doing your work, but that's beyond the scope of this question.


Shareable plates, craft cocktails and Parker's rooftop location welcome you to come as you are for an elevated experience you won't soon forget.
Parker is delighted to offer one of the best happy hours on the Plaza from 4:00pm to 6:00pm, Monday through Friday.
*These items contain raw or undercooked ingredients. Consuming raw or undercooked food may increase your risk of foodborne illness. Please inform your server of dietary restrictions or allergies as substitutions are available.


Born and brought up in Northern Sweden Ingrid worked as a Psychiatric Social Worker until coming to Britain in 1980. Training in Art and Design at Manchester changed her career and since 2001 she has worked as an artist based near Buxton and a well established member of Peak District Artisans. Home is a series of mixed media reflections, one for each month of the year, on her identity as an Anglo-Swedish person in the Peak District.
The Exhibition will open on 1st September in the Sir Richard Morris Lounge at Derby Cathedral Centre and continue until 31st October, Monday to Saturday 9am to 5pm, closed Sundays.