API Reference¶
Classes¶
Data¶
-
class
prms_python.
Data
(base_file=None, na_rep=-999)[source]¶ Object to access or create a PRMS data file with ability to load/assign it to a date-time indexed pandas.DataFrame for data management, analysis and visualization. It can be used to build a new PRMS data file from user defined metadata and a
pandas.DataFrame
of PRMS datetime-indexed climatic forcing and observation variables.The class properties
metadata
anddata_frame
can be later assigned if nobase_file
is given on initialization, allowing for the creation of PRMS climatic forcing file in a Python environment.Keyword Arguments: -
date_header
¶ list – date and time header for PRMS data file
-
valid_input_variables
¶ tuple – valid hydro-climate variables for PRMS data file
Note
If using the
Data
class to create a new data file, it is up to the user to ensure that the metadata andpandas.DataFrame
assigned are correct and compatible.-
data_frame
¶ A property that gets and sets the climatic forcing data for a standard PRMS climate input data file as a
pandas.DataFrame
.Example
d is a Data instance, calling
>>> d.data_frame input variables runoff 1 runoff 2 runoff 3 precip tmax tmin date 1996-12-27 0.54 1.6 NaN 0.0 46 32.0 1996-12-28 0.65 1.6 NaN 0.0 45 24.0 1996-12-29 0.80 1.6 NaN 0.0 44 28.0 1996-12-30 0.90 1.6 NaN 0.0 51 33.0 1996-12-31 1.00 1.7 NaN 0.0 47 32.0
shows the date-indexed
pd.DataFrame
of the input data that is created when aData
object is initiated if given a validbase_file
, i.e. file path to a PRMS climate data file.Raises: ValueError
– if attribute is accessed before either assigning a PRMS data file onData
initialization or not assigning a compatabile date-indexedpandas.DataFrame
of hydro-climate variables.TypeError
– if a data type other thanpandas.DataFrame
is assigned.
-
metadata
¶ dict
– A property that gets and sets the header information from a standard PRMS climate input data file held in a Python dictionary. As a property it can be assigned directly to overwrite or create a new PRMS data file. As such the user is in control and must supply the correct syntax for PRMS standard data files, e.g. text lines before header should begin with “//”. Here is an example of the information gathered and held in this attribute:Example
>>> data.metadata { 'data_startline' : 6, 'data_variables' : ['runoff 1', 'runoff 2', 'tmin', 'tmax', 'ppt'] 'text_before_header' : "Title of data file \n //some comments\nrunoff 2 \ntmin 1\ntmax 1\nppt 1\nrunoff 2\ntmin 1 \ntmax 1\nppt 1\n ########################################\n" }
Note
When assigning or creating a new data file, the
Data.write
method will assign the appropriate date header that follows the line of number signs “#”.Raises: ValueError
– if data in metadata is accessed before data is assigned, e.g. if accessed to write a PRMS data file from aData
instance that was initialized without a valid PRMS data file.TypeError
– if an object that is not a Python dictionary is assigned.
-
modify
(func, vars_to_adjust)[source]¶ Apply a user defined function to one or more variable(s) in the data file.
The
modify
method allows for inplace modification of one or more time series inputs in the data file based on a user defined function.Parameters: Returns: None
Example
Here is an example of loading a data file, modifying the temperature inputs (tmin and tmax) by adding two degrees to each element, and rewritting the modified data to disk,
>>> d = Data('path_to_data_file') >>> def f(x): return x + 2 >>> d.modify(f,['tmax','tmin']) >>> d.write('data_temp_plus_2')
-
write
(out_path)[source]¶ Writes the current state of the
Data
to PRMS text format utilizing theData.metadata
andData.data_frame
instance properties. IfData.data_frame
was never accessed or assigned new values then this method simply copies the original PRMS data file toout_path
.Parameters: out_path (str) – full path to save or copy the current PRMS data in PRMS text format. Returns: None Raises: ValueError
– if thewrite
method is called without assigning either an initial data (base_file
) path or assigning correctmetadata
anddata_frame
properties.
-
Parameters¶
-
class
prms_python.
Parameters
(base_file)[source]¶ Disk-based representation of a PRMS parameter file.
For the sake of memory efficiency, we only load parameters from
base_file
that get modified through item assignment or accessed directly. Internally, a reference is kept to only previously accessed parameter data, so whenwrite
is called most copying is frombase_file
directly. When parameters are accessed or modified using the dictionary-like syntax, anp.ndarray
representation of the parameter is returned. As a resultnumpy
mathematical rules including efficient vectorization of math applied to arrays can be applied to modify parameters directly. TheParameter
objects user methods allow for visualization of most PRMS parameters, function based modification of parameters, and a write function that writes the data back to PRMS text format.Parameters: base_file (str) – path to PRMS parameters file -
base_file
¶ str – path to PRMS parameters file
-
base_file_reader
¶ file – file handle of PRMS parameters file
-
dimensions
¶ collections.OrderedDict
– dictionary with parameter dimensions as defined in parameters file loaded on initialization
-
base_params
¶ list of dicts – list of dictionaries of parameter metadata loaded on initialization e.g. name, dimension(s), data type, length of data array, and lines where data starts and ends in file
-
param_arrays
¶ dict – dictionary with parameteter names as keys and
numpy.array
andnumpy.ndarray
representations of parameter values as keys. Initially empty, uses getter and setter functions.
Example
>>> p = Parameters('path/to/a/parameter/file') >>> p['jh_coef'] = p['jh_coef']*1.1 >>> p.write('example_modified_params')
will read parameter information from the params file to check that jh_coef is present in the parameter file, read the lines corresponding to jh_coef data and assign the new value as requested. Calling the
write
method next will copy all parameters except jh_coef to the new parameter file and append the newly modified jh_coef to the end of the new file from the modified values stored in the parameter instancep
.-
plot
(nrows, which='all', out_dir=None, xlabel=None, ylabel=None, cbar_label=None, title=None, mpl_style=None)[source]¶ Versatile method that plots most parameters in a standard PRMS parameter file assuming the PRMS model was built on a uniform spatial grid.
Plots parameters as line plots for series or 2D spatial grid depending on parameter dimension. The PRMS parameter file is assumed to hold parameters for a model that was set up on a uniform rectangular grid with the spatial index of HRUs starting in the upper left corner and moving left to right across columns and down rows. Default function is to print four files, each with plots of varying parameter dimensions as explained under Kwargs
which
and more detailed explanation in the example Jupyter notebook.Parameters: nrows (int) – The number of rows in the PRMS model grid for plotting spatial parameters. Will only work correctly for rectangular gridded models with HRU indices starting in the upper left cell moving left to right across columns and down across rows.
Keyword Arguments: - which (str) – name of PRMS parameter to plot or ‘all’. If ‘all’ then the function will print 3 multipage pdfs, one for nhru dimensional parameters, one for nhru by monthly parameters, one for other parameters of length > 1, and one html file containing single valued parameters.
- out_dir (str) – path to an output dir, default current directory
- xlabel (str) – x label for plot(s)
- ylabel (str) – y label for plot(s)
- cbar_label (str) – label for colorbar on spatial plot(s)
- title (str) – plot title
- mpl_style (str, list) – name or list of names of matplotlib style sheets to use for plot(s).
Returns: None
Examples
If the plot method is called with the keyword argument
which
set to a parameter that has length one, i.e. single valued it will simply print out the value e.g.:>>> p = Parameters('path/to/parameters') >>> p.plot(nrows=10, which='radj_sppt') radj_sppt is single valued with value: 0.4924942352224324
The default action is particularly useful which makes four multi-page pdfs of most PRMS parameters where each file contains parameters of different dimensions e.g.:
>>> p.plot(nrows=10, which='all', mpl_style='ggplot')
will produce the following four files named by parameters of certain dimensions:
>>> import os >>> os.listdir(os.getcwd()) # list files in current directory nhru_param_maps.pdf nhru_by_nmonths_param_maps.pdf non_spatial_param_plots.pdf single_valued_params.html
-
write
(out_name)[source]¶ Writes current state of
Parameters
to disk in PRMS text formatTo reduce memory usage the
write
method copies parameters from the initialbase_file
parameter file for all parameters that were never modified.Parameters: out_name (str) – path to write Parameters
data to PRMS text format.Returns: None
-
Simulation¶
-
class
prms_python.
Simulation
(input_dir=None, simulation_dir=None)[source]¶ Class that runs and manages file structure for a single PRMS simulation.
The
Simulation
class provides low-level managment of a PRMS simulation by copying model input files frominput_dir
argument to an output dirsimulation_dir
. The file stucture for an individual simulation after calling therun
method is simple, two subdirectories “inputs” and “outputs” are created undersimulation_dir
and the respective input and output files from the current PRMS simulation are transfered there after theSimulation.run()
method is called which executes the PRMS model, (see examples below inSimulation.run()
).A
Simulation
instance checks that all required PRMS inputs (control, parameters, data) exist in the expected locations. If simulation_dir is provided and does not exist, it will be created. If it does exist it will be overwritten.Keyword Arguments: Example
see
Simulation.run()
Raises: RuntimeError
– if input directory does not contain a PRMS data, parameters, and control file.-
classmethod
from_data
(data, parameters, control_path, simulation_dir)[source]¶ Create a
Simulation
from aData
andParameter
object, plus a path to the control file, and providing asimulation_dir
where the simulation should be run.Parameters: - data (
Data
) –Data
object for simulation - parameters (
Parameters
) –Parameters
object for simulation - control_path (str) – path to control file
- simulation_dir (str) – path to directory where simulations will be run and where input and output will be stored. If it exists it will be overwritten.
Returns: Simulation
ready to be run usingsimulation_dir
forinputs and outputs
Example
>>> d = Data('path_to_data_file') >>> p = Parameters('path_to_parameters_file') >>> c = 'path_to_control_file' >>> sim_dir = 'path_to_create_simulation' >>> sim = Simulation.from_data(d, p, c, sim_dir) >>> sim.run()
Raises: TypeError
– ifdata
andparameters
arguments are not of typeData
andParameters
- data (
-
run
(prms_exec='prms')[source]¶ Run a
Simulation
instance using PRMS input files frominput_dir
and copy to theSimulation
file structure undersimulation_dir
if given, otherwise leave PRMS input output unstructured and ininput_dir
This method runs a single PRMS simulation from a
Simulation
instance, waits until the process has completed and then transfers model input and output files to respective newly created directories. See example of the file structure that is created under different workflows of therun
method below.Keyword Arguments: prms_exec (str) – name of PRMS executable on $PATH or path to executable Examples
If we create a
Simulation
instance by only assigning theinput_dir
argument and call itsrun
method the model will be run in theinput_dir
and all model input and output files will remain ininput_dir
,>>> import os >>> input_dir = os.path.join( 'PRMS-Python', 'prms_python', 'models', 'lbcd' ) >>> os.listdir(input_dir) ['data', 'data_3deg_upshift', 'parameters', 'parameters_adjusted', 'control'] >>> sim = Simulation(input_dir) >>> sim.run() >>> os.listdir(input_dir) # all input and outputs in input_dir ['data', 'data_3deg_upshift', 'parameters', 'parameters_adjusted', 'control', 'statvar.dat', 'prms_ic.out', 'prms.out' ]
Instead if we assigned a path for
simulation_dir
keyword argument and then calledrun
, i.e.>>> sim = Simulation(input_dir, 'path_simulation') >>> sim.run()
the files structure for the PRMS simulation created by
Simulation.run()
would be:path_simulation ├── inputs │ ├── control │ ├── data │ └── parameters └── outputs ├── data_3deg_upshift ├── parameters_adjusted ├── prms_ic.out ├── prms.out └── statvar.dat
Note
As shown in the last example, currently the
Simulation.run
routine only recognizes the data, parameters. and control file as PRMS inputs, all other files found ininput_dir
before and after normal completion of the PRMS simulation will be transferred tosimulation_dir/outputs/
.
-
classmethod
SimulationSeries¶
-
class
prms_python.
SimulationSeries
(simulations)[source]¶ Series of simulations all to be run through a common interface.
Utilizes
multiprocessing.Pool
class to parallelize the execution of series of PRMS simulations. SimulationSeries also allows the user to define the PRMS executable command which is set to “prms” as default. It is best to add the prms executable to your $PATH environment variable. Each simulation that is run throughSimulationSeries
will follow the strict file structure as defined bySimulation.run()
. This class is useful particularly for creating new programatic workflows not provided yet by PRMS-Python.Parameters: simulations (list or tuple) – list of Simulation
objects to be run.Example
Lets say you have already created a series of PRMS models by modifying the input climatic forcing data, e.g. you have 100 data files and you want to run each using the same control and parameters file. For simplicity lets say there is a directory that contains all 100 data files e.g. data1, data2, … or whatever they are named and nothing else. This example also assumes that you want each simulation to be run and stored in directories named after the data files as shown.
>>> data_dir = 'dir_that_contains_all_data_files' >>> params = Parameters('path_to_parameter_file') >>> control_path = 'path_to_control' >>> # a list comprehension to make multiple simulations with >>> # different data files, alternatively you could use a for loop >>> sims = [ Simulation.from_data ( Data(data_file), params, control_path, simulation_dir='sim_{}'.format(data_file) ) for data_file in os.listdir(data_dir) ]
Next we can use
SimulationSeries
to run all of these simulations in parrallel. For example we may use 8 logical cores on a common desktop computer.>>> sim_series = SimulationSeries(sims) >>> sim_series.run(nprocs=8)
The
SimulationSeries.run()
method will run all 100 simulations where chunks of 8 at a time will be run in parrallel. Inputs and outputs of each simulation will be sent to each simulation’ssimulation_dir
following the file structure ofSimulation.run()
.Note
The
Simulation
andSimulationSeries
classes are low-level in that they alone do not create metadata for PRMS simulation scenarios. In other words they do not produce any additional files that may help the user know what differs between individual simulations.-
outputs_iter
()[source]¶ Return a
generator
of directories with the path to thesimulation_dir
as well as paths to the statvar.dat output file, and data and parameters input files used in the simulation.Yields: dict
–- dictionary of paths to simulation directory,
input, and output files.
Example
>>> ser = SimulationSeries(simulations) >>> ser.run() >>> g = ser.outputs_iter()
Would return something like
>>> print(g.next()) { 'simulation_dir': 'path/to/sim/', 'statvar': 'path/to/statvar', 'data': 'path/to/data', 'parameters': 'path/to/parameters' }
-
run
(prms_exec='prms', nproc=None)[source]¶ Method to run multiple
Simulation
objects in parrallel.Keyword Arguments: Example
see
SimulationSeries
Note
If
nproc
is not assigned the deault action is to use half of the available processecors on the machine using the Pythonmultiprocessing
module.
-
Scenario¶
-
class
prms_python.
Scenario
(base_dir, scenario_dir, title=None, description=None)[source]¶ Container for the process in which one modifies input parameters then runs a simulation while tracking metadata.
Metadata includes a title and description, if provided, plus start/end datetime, and parameter names of parameters that were modified including string representations of the Python modification functions that were applied to each parameter. The metadata file is in
json
format making it conveniently read as a Python dictionary.Parameters: - base_dir (str) – path to directory that contains initial control,
parameter, and data files to be used for
Scenario
. The parameters file inbase_dir
will not be modifed instead will be copied toscenario_dir
and them modified. - scenario_dir (str) – directory path to bundle inputs and outputs
- title (str, optional) – title of
Scenario
, if given will be added toScenario.metadata
attribute as well as themetadata.json
file inscenario_dir
written after calling theScenario.build()
andScenario.run()
methods. - description (str, optional) – description of
Scenario
, also is added toScenario.metadata
astitle
.
-
metadata
¶ scenario.ScenarioMetadata
– a dictionary-like class inprms_python.scenario
that tracksScenario
andScenarioSeries
imformation including user-defined parameter modifications and descriptions, and file structure.
Examples
This example is kept simple for clarity, here we adjust a single PRMS parameter tmin_lapse by using a single arbitrary mathematical function. We use the example PRMS model included with PRMS-Python for this example,
>>> input_dir = 'PRMS-Python/test/data/models/lbcd' >>> scenario_directory = 'scenario_testing' >>> title = 'Scenario example' >>> desc = 'adjust tmin_lapse using sine wave function' >>> # create Scenario instance >>> scenario_obj = Scenario ( base_dir=input_dir, scenario_dir=scenario_directory, title=title, description=desc )
Next we need to build a dictionary to modify, in this case tmin_lapse, here we use a vectorized sine function
>>> # build the modification function and dictionary >>> def a_func(arr): return 4 + np.sin(np.linspace(0,2*np.pi,num=len(arr))) >>> # make dictionary with parameter names as keys and modification >>> # function as values >>> param_mod_dic = dict(tmin_lapse=a_func) >>> scenario_obj.build(param_mod_funs=param_mod_dic)
After building a
Scenario
instance the input files are copied toscenario_dir
which was assigned ‘scenario_testing’:scenario_testing ├── control ├── data └── parameters
After calling
build
the input files frominput_dir
were first copied toscenario_dir
and then the functions inparam_mod_dic
are applied the the parameters names (key) inparam_mod_dic
. To run theScenario
use the therun
method>>> scenario_obj.run()
Now the simulation is run and the
metadata.json
file is created, the final file structure will be similar to this:scenario_testing ├── inputs │ ├── control │ ├── data │ └── parameters ├── metadata.json └── outputs ├── prms_ic.out ├── prms.out └── statvar.dat
Finally, here is what is contained in
metadata.json
for this example which is also updates in theScenario.metadata
>>> scenario_obj.metadata { 'title': 'Scenario example', 'description': 'adjust tmin_lapse using sine wave function', 'start_datetime': '2018-09-01T19:20:21.723003', 'end_datetime': '2018-09-01T19:20:31.117004', 'mod_funs_dict': { 'tmin_lapse': 'def parab(arr): return 4 + np.sin(np.linspace(0,2*np.pi,num=len(arr)))' } }
As shown the metadata retirieved the parameter modification function as a string representation of the exact Python function(s) used for modifying the user-defined parameter(s).
Note
The main differentiator between
Scenario
andScenarioSeries
is thatScenario
is designed for modifying one or more parameters of a single parameters file whereasScenarioSeries
is designed for modifying and tracking the modification of one or more parameters in multiple PRMS parameters files, therefore resulting in multiple PRMS simulations.-
build
(param_mod_funs=None)[source]¶ Take a user-defined dictionary with param names as keys and Python functions as values, copy the original input files as given when initializing a
Scenario
instance to thesimulation_dir
then apply the functions in the user-defined dictionary to the parameters there. Thebuild
method must be called before running theScenario
(callingScenario.run()
).Keyword Arguments: param_mod_funs (dict) – dictionary with parameter names as keys and Python functions as values to apply to the names (key) Returns: None Example
see
Scenario
for a full example.Note
If the
scenario_dir
that was assigned for the current instance already exists, it will be overwritten whenbuild
is invoked.
-
run
(prms_exec='prms')[source]¶ Run the PRMS simulation for a built
Scenario
instance.Keyword Arguments: prms_exec (str) – name of PRMS executable on $PATH or path to executable Returns: None Examples
see
Scenario
for full exampleRaises: RuntimeError
– if theScenario.build()
method has not yet been called.
- base_dir (str) – path to directory that contains initial control,
parameter, and data files to be used for
ScenarioSeries¶
-
class
prms_python.
ScenarioSeries
(base_dir, scenarios_dir, title=None, description=None)[source]¶ Create and manage a series of model runs where parameters are modified.
First initialize the series with an optional title and description. Then to build the series the user provides a list of dictionaries with parameter-function key-value pairs, and optionally a title and description for each dictionary defining the individual scenario.
The ScenarioSeries’
build
method creates a file structure under the series directory (scenarios_dir
) where each subdirectory is named with auuid
which can be later matched to its title using the metadata inscenario_dir/series_metadata.json
(seejson
). In the future we may add a way for the user to access the results of the scenario simulations directly through theScenarioSeries
instance, but for now the results are written to disk. Therefore each scenario’s title metadata can be used to refer to which parmaters were modified and how for post-processing and analysis. One could also use the description metadata for this purpose.Parameters: Keyword Arguments: -
metadata
¶ dict – dictionary with title, description, and UUID map dictionary for individiual
Scenario
output directories, the UUID dictionary (uuid_title_map
)is left empty until callingScenarioSeries.build()
.
-
scenarios
¶ list – empty list that will be filled with ``Scenario``s after defining them by calling
ScenarioSeries.build()
.
Example
There are three steps to both
Scenario
and ScenarioSeries, first we initialize the object>>> series = ScenarioSeries( base_dir = 'dir_with_input_files', scenarios_dir = 'dir_to_run_series', title = 'title_for_group_of_scenarios', description = 'description_for_scenarios' )
The next step is to “build” the
ScenarioSeries
by calling theScenarioSeries.build()
method which defines which parameters to modify, how to modify them, and then performs the modification which readies the series to be “run” (the last step). See theScenarioSeries.build()
method for the next step example.Also see Scenario & ScenarioSeries for full example
-
build
(scenarios_list)[source]¶ Build the scenarios from a list of scenario definitions in dicitonary form.
Each element of
scenarios_list
can have any number of parameters as keys with a function for each value. The other two acceptable keys aretitle
anddescription
which will be passed on to each individual Scenario’s metadata inseries_metadata.json
for future lookups. Thebuild
method also creates a file structure that uses UUID values as individiualScenario
subdirectories as shown below.Parameters: scenarios_list (list) – list of dictionaries with key-value pairs being parameter-function definition pairs or title-title string or description-description string. Returns: None Examples
Following the initialization of a
ScenarioSeries
instance as shown the example docstring there, we “build” the series by defining a list of param named-keyed function-valued dictionaries. This example uses arbitrary functions on two PRMS parameters snowinfil_max and snow_adj,>>> def _function1(x): #Note, function must start with underscore return x * 0.5 >>> def _function2(x): return x + 5 >>> dic1 = {'snowinfil_max': _function1, 'title': 'scenario1'} >>> dic2 = {'snowinfil_max': _function2, 'snow_adj': function1, 'title': 'scenario2', 'description': 'we adjusted two snow parameters' } >>> example_scenario_list = [dic1, dic2] >>> # now we can build the series >>> series.build(example_scenario_list)
In this example that follows from
ScenarioSeries
example the file structure that is created by thebuild
method is as follows:dir_to_run_series ├── 670d6352-2852-400a-997e-7b12ba34f0b0 │ ├── control │ ├── data │ └── parameters ├── base_inputs │ ├── control │ ├── data │ └── parameters ├── ee9526a9-8fe6-4e88-b357-7dfd7111208a │ ├── control │ ├── data │ └── parameters └── series_metadata.json
As shown the build method has copied the original inputs from the
base_dir
given on initialization ofScenarioSeries
to a new subdirectory of thescenarios_dir
, it also applied the modifications to the parameters for both scenarios above and move the input files to their respective directories. At this stage themetadata
will not have updated the UUID map dictionary to each scenarios subdirectory because they have not yet been run. See theScenarioSeries.run()
method for further explanation including the final file structure and metadata file contents.
-
classmethod
from_parameters_iter
(base_directory, parameters_iter, title=None, description=None)[source]¶ Alternative way to initialize and build a
ScenarioSeries
in one step.Create and build a
ScenarioSeries
by including the param-keyed- function-valued dictionary (parameters_iter
) that is otherwise passed inScenarioSeries.build()
.Parameters: - base_directory (str) – directory that contains model input files
- parameters_iter (list of dicts) – list of dictionaries for each
Scenario
as described inScenario
andScenarioSeries.build()
. - title (str) – title for group of scenarios
- description (str) – description for group of scenarios
Returns: None
-
run
(prms_exec='prms', nproc=None)[source]¶ Run a “built”
ScenarioSeries
and make final updates to file structure and metadata.Keyword Arguments: - prms_exec (str) – name of PRMS executable on $PATH or path to executable. Default = ‘prms’
- nproc (int or None) – number of processceors available to
parallelize PRMS simulations, if None (default) then use
half of what the
multiprocessing
detects on the machine.
Returns: None
Examples
This example starts where the example ends in
ScenarioSeries.build()
, callingrun
will run the models for all scenarios and then update the file structureas well as create individual
Scenario
metadata files as such:dir_to_run_series ├── 5498c21d-d064-45f4-9912-044734fd230e │ ├── inputs │ │ ├── control │ │ ├── data │ │ └── parameters │ ├── metadata.json │ └── outputs │ ├── prms_ic.out │ ├── prms.out │ └── statvar.dat ├── 9d28ec5a-b570-4abb-8000-8dac113cbed3 │ ├── inputs │ │ ├── control │ │ ├── data │ │ └── parameters │ ├── metadata.json │ └── outputs │ ├── prms_ic.out │ ├── prms.out │ └── statvar.dat ├── base_inputs │ ├── control │ ├── data │ └── parameters └── series_metadata.json
As we can see the file structure follows the combined structures as defined by
Simulation
andScenario
. The content of the top-level metadata fileseries_metadata.json
is as such:{ "title": "title_for_group_of_scenarios", "description": "description_for_scenarios", "uuid_title_map": { "5498c21d-d064-45f4-9912-044734fd230e": "scenario1", "9d28ec5a-b570-4abb-8000-8dac113cbed3": "scenario2" } }
Therefore one can use the
json
file to track between UUID’s and individual scenario titles. The json files are read as a Python dictionary which makes them particularly convenient. The contents of an individual scenariosmetadata.json
file included a string representation of the function(s) that were applied to the paramter(s):{ "description": null, "end_datetime": "2018-09-03T00:00:40.793817", "mod_funs_dict": { "snowinfil_max": "def _function1(x): return x * 0.5" }, "start_datetime": "2018-09-03T00:00:30.421353", "title": "scenario1" }
Note
As shown, it is important to give appropriate scenario titles when building a
ScenarioSeries
dictionary in order to later understand how parameters were modified in each scenario. If not one would have to rely on the individualmetadata.json
files in each scenario directory which may be more cumbersome.
-
Optimizer¶
-
class
prms_python.
Optimizer
(parameters, data, control_file, working_dir, title, description=None)[source]¶ Container for PRMS parameter optimization and related routines.
Currently the
monte_carlo
method provides random parameter resampling routines using uniform and normal random variables.Example
>>> from prms_python import Data, Optimizer, Parameters >>> params = Parameters('path/to/parameters') >>> data = Data('path/to/data') >>> control = 'path/to/control' >>> work_directory = 'path/to/create/simulations' >>> optr = Optimizer( params, data, control, work_directory, title='the title', description='desc') >>> measured = 'path/to/measured/csv' >>> statvar_name = 'basin_cfs' # or any other valid statvar >>> params_to_resample = ['dday_intcp', 'dday_slope'] # list of params >>> optr.monte_carlo(measured, params_to_resample, statvar_name)
-
monte_carlo
(reference_path, param_names, statvar_name, stage, n_sims=10, method='uniform', mu_factor=1, noise_factor=0.1, nproc=None)[source]¶ The
monte_carlo
method ofOptimizer
performs parameter random resampling techniques to a set of PRMS parameters and executes and manages the corresponding simulations.Parameters: Keyword Arguments: - n_sims (int) – number of simulations to conduct parameter optimization/uncertaitnty analysis.
- method (str) – resampling method for parameters (normal or uniform)
- mu_factor (float) – coefficient to scale mean of the parameter(s) to resample from when using the normal distribution to resample i.e. a value of 1.5 will sample from a normal rv with mean 50% higher than the original parameter mean
- noise_factor (float) – scales the variance of noise to add to parameter values when using normal rv (method=’normal’)
- nproc (int) – number of processors available to run PRMS simulations
Returns: None
-
plot_optimization
(freq='daily', method='time_series', plot_vars='both', plot_1to1=True, return_fig=False, n_plots=4)[source]¶ Basic plotting of current optimization results with limited options. Plots measured, original simluated, and optimization simulated variabes Not recommended for plotting results when n_sims is very large, instead use options from an OptimizationResult object, or employ a user-defined method using the result data.
Keyword Arguments: - freq (str) – frequency of time series plots, value can be ‘daily’ or ‘monthly’ for solar radiation
- method (str) – ‘time_series’ for time series sub plot of each simulation alongside measured radiation. Another choice is ‘correlation’ which plots each measured daily solar radiation value versus the corresponding simulated variable as subplots one for each simulation in the optimization. With coefficients of determiniationi i.e. square of pearson correlation coef.
- plot_vars (str) – what to plot alongside simulated srad: ‘meas’: plot simulated along with measured swrad ‘orig’: plot simulated along with the original simulated swrad ‘both’: plot simulated, with original simulation and measured
- plot_1to1 (bool) – if True plot one to one line on correlation scatter plot, otherwise exclude.
- return_fig (bool) – flag whether to return matplotlib figure
Returns: - If kwarg return_fig=True, then return
copy of the figure that is generated to the user.
Return type: f (
matplotlib.figure.Figure
)
-
OptimizationResult¶
-
class
prms_python.
OptimizationResult
(working_dir, stage)[source]¶ The
OptimizationResult
object serves to collect and manage output from anOptimizer
method. Upon initialization and a given optimization stage that was used when running the Optimizer method, e.g.monte_carlo
, the class gathers all JSON metadata that was produced for the given stage. TheOptimizationResult
has three main user methods: firstresult_table
which returns the top n simulations according to four model performance metrics (Nash-Sutcliffe efficiency (NSE), root-mean squared-error (RMSE), percent bias (PBIAS), and the coefficient of determination (COEF_DET) as calculated against measured data. For example the table may look like:>>> ddsolrad_res = OptimizationResult(work_directory, stage=stage) >>> top10 = ddsolrad_res.result_table(freq='monthly',top_n=10) >>> top10 ======================== ======== ======= ========= ======== ddsolrad parameters NSE RMSE PBIAS COEF_DET ======================== ======== ======= ========= ======== orig_params 0.956267 39.4725 -0.885715 0.963116 tmax_index_54.2224631748 0.921626 47.6092 -0.849256 0.94402 tmax_index_44.8823940703 0.879965 58.9194 5.79603 0.922021 tmax_index_47.6835387480 0.764133 82.5918 -4.78896 0.837582 ======================== ======== ======= ========= ========
Second, the
get_top_ranked_sims
which returns a dictionary that map key information about the top n ranked simulations, an example returned dictionary may look like:>>> { 'dir_name' : ['pathToSim1', 'pathToSim2'], 'param_path' : ['pathToSim1/input/parameters', 'pathToSim2/input/parameters'], 'statvar_path' : ['pathToSim1/output/statvar.dat', 'pathToSim2/output/statvar.dat'], 'params_adjusted' : [[param_names_sim1], [param_names_sim2]] }
The third method of
OptimizationResult
isarchive
which essentially opens all parameter and statvar files from each simulation of the given stage and archives the parameters that were modified and their modified values and the statistical variable (PRMS time series output) that is associated with the optimization stage. OtherOptimizer
simulation metadata is also gathered and new JSON metadata containing only this information is created and written within a newly created “archived” subdirectory within the same directory that theOptimizer
routine managed simulations. TheOptimizationResult.archive
method then recursively deletes the simulation data for each of the given stage.-
archive
(remove_sims=True, remove_meta=False, metric_freq='daily')[source]¶ Create archive directory to hold json files that contain information of adjusted parameters, model output, and performance metrics for each Optimizer simulation of the OptimizationResult.stage in the OptimizationResult.working_dir.
Keyword Arguments: - remove_sims (bool) – If True recursively delete all folders and files associated with original simulations of the OptimizationResult.stage in the OptimizationResult.working_dir, if False do not delete simulations.
- remove_meta (bool) – Whether to delete original Optimizer JSON metadata files, default is False.
- metric_freq (Str) – Frequency of output metric computation for recording of model performance. Can be ‘daily’ (default) or ‘monthly’. Note, other results can be computed later with archived results.
Returns: None
-
Select helper functions¶
modify_params¶
-
prms_python.
modify_params
(params_in, params_out, param_mods=None)[source]¶ Given a parameter file in and a dictionary of param_mods, write modified parameters to params_out.
Parameters: Keyword Arguments: param_mods (dict) – param name-keyed, param modification function-valued
Returns: None
Example
Below we modify the monthly jh_coef parameter by increasing it 10% for every month,
>>> params_in = 'models/lbcd/parameters' >>> params_out = 'scenarios/jh_coef_1.1/params' >>> scale_10pct = lambda x: x * 1.1 >>> modify_params(params_in, params_out, {'jh_coef': scale_10pct})
So param_mods is a dictionary of with keys being parameter names and values a function that operates on a single value. Currently we only accept functions that operate without reference to any other parameters. The function will be applied to every cell, month, or cascade routing rule for which the parameter is defined.
resample_param¶
-
prms_python.optimizer.
resample_param
(params, param_name, how='uniform', mu_factor=1, noise_factor=0.1)[source]¶ Resample PRMS parameter by shifting all values by a constant that is taken from a uniform distribution, where the range of the uniform values is equal to the difference between the min and max of the allowable range. The parameter min and max are set in
Optimizer.param_ranges
. If the resampling method (how
argument) is set to ‘normal’, randomly sample a normal distribution with mean = mean(parameter) Xmu_factor
and sigma = param allowable range multiplied bynoise_factor
. If parameters have array length <= 366 then individual parameter values are resampled otherwise resample all param values at once, e.g. by taking a single random value from the uniform distribution. If they are taking all at once using the normal method then the original values are scaled by mu_factor and a normal random variable with mean=0 and std dev = parameter range Xnoise_factor
.Parameters: - params (
prms_python.Parameters
) –Parameters
object - param_name (str) – name of PRMS parameter to resample
Keyword Arguments: - how (str) – distribution to resample parameters from in the case that each parameter element can be resampled (len <=366) Currently works for uniform and normal distributions.
- noise_factor (float) – factor to multiply parameter range by, use the result as the standard deviation for the normal rand. variable used to add element wise noise. i.e. higher noise_factor will result in higher variance. Must be > 0.
Returns: ndarray of param after resampling
Return type: ret (
numpy.ndarry
)Raises: KeyError
– ifparam_name
not a valid parameter nameValueError
– if the parameter range has not been set inOptimizer.param_ranges
- params (


← Back
Credits
Clue
This Text will show if the Browser does NOT support HTML5 Canvas tag
Use the characters below to complete the word/ code, or click hint to get a clue.
Hint
Play again


2. jsCoFE Task Development: Input Data¶
Most of tasks must have input facilities in order to receive data from other tasks and various parameters set by user. We will now do modifications to the Hello World! task we introduced in jsCoFE Task Development: Hello World!, so that the task will be able to accept both data objects and parameters.
2.1. Data exchange in jsCoFE¶
jsCoFE tasks exchange data in terms of data objects, rather than raw files.
Data object may be equivalent to file, but it may be also part of a file or
a combination of data from several files or their parts. Whenever a data exchange
is required, it is done on the level of metadata objects, represented by short
JSON-formatted files, which contain reference(s) to files with actual data.
Therefore, before running on a number cruncher, jsCoFE’s task must receive a
metadata object, describing a particular data type, and actual files it refers
to. By design, the metadata comes in the input_data
field of task class, and
actual files are put automatically by jsCoFE framework in the job’s input
subdirectory on the Front-End server before sending all job directory to
number cruncher.
Most of technical details of data exchange in jsCoFE are hidden from task developer, and knowing them should not be required for task development. We will demonstrate handling task input data on he example of the Hello World! task, introduced in jsCoFE Task Development: Hello World!.
2.2. Specifying input data in Task Class¶
Suppose we would like our task to deal with macromolecular coordinate data, and the number of datasets that a user can give to task should vary from 0 (no input data) to 20. This is achieved by putting the following construct:
this.input_dtypes = [{ // input data types
data_type : {'DataXYZ':[]}, // data type(s) and subtype(s)
label : 'XYZ Coordinates', // label for input dialog
inputId : 'xyz', // input Id for referencing input fields
force : 1, // show 1 dataset if few are available
version : 0, // minimal version data acceptable
min : 0, // minimum acceptable number of data instances
max : 20 // maximum acceptable number of data instances
}
];
in Task Class constructor (which is TaskHelloWorld()
in this particular case). Detail description of all items in input construct is
given in Reference: Input Data Descriptors.
You may now insert the above fragment in function TaskHelloWorld()
in file
js-common/tasks/common.helloworld.js
and advance task version in function
currentVersion()
in the same file. Then restart all jsCoFE servers and
reload jsCoFE in your browser and go to your project with Hello World! tasks.
First, try to clone the previous job – the framework should prevent you of doing so because we have changed the interface version number. This is done in order to prevent possible inconsistencies. For example, in this case, Task Driver will look for input data constructs in the cloned job, and may crash because of not finding any.
Second, create a new Hello World! task and open the job dialog. You may see no changes, which will mean that there is no XYZ data in project, and, therefore, the framework does not create any input fields. If this is the case, open Data Import task from the task list and import one or a few PDB files, and then add Hello World! task after data import. Then the corresponding input field should appear.
Note that if we’ve put minimum number of datasets equal to 1, the job dialog
would not even open if there is no coordinate data in the project (try to imitate
this situation). Also note that if we omit force
parameter or set it equal
to 0, then the input field appears without any data loaded and says [do not use],
which is used in case of optional dataset. Also check how the input field
behaves when you have more than one coordinate dataset in the project – it
should prompt inputting more dataset with additional fields appearing after
choosing a value in the current one up to the total number of 20.
Finally, note that if a task needs more than a single data type on input,
the corresponding constructs, similar to one sampled above, should be added
as items to the input_dtypes
list. They will be laid out in Job Dialog
in order of their appearance in the list.
Full source code of the modified Hello World! Task Class may be downloaded
from here
.
2.3. Getting input data in Task Driver¶
Data objects, chosen by user, should be received in Task Driver (cf.
Making the Task Driver), and corresponding data passed to relevant application for
processing. jsCoFE framework works in such way that data objects arrive in
structure self.input_data.data
, where they appear under identifiers
corresponding to chosen inputId
in their Task Class descriptions. For our
Hello World! example, the coordinate data objects are accessible in
Task Driver module as:
xyz = self.input_data.data.xyz
Here, self.input_data.data
is constant part, which will be the same in all
cases, and .xyz
corresponds to the chosen value of inputId
field of the
input data construct introduced above. The framework passes
only python dictionaries, rather than the corresponding Data Classes. If
necessary, the dictionaries may be converted to Data Classes as:
xyz = self.input_data.data.xyz
for i in range(len(xyz)):
xyz[i] = self.makeClass ( xyz[i] )
which is useful in many cases because Data Classes provide a number of convenience functions for data manipulation.
We will now modify our Hello World!’s Task Driver such that it identifies whether a user have selected input data or not, and if yes, prints the metadata and raw data for all chosen data objects in standard output. The corresponding Task Driver’s code may look like the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | ##!/usr/bin/python
import os
from pycofe.tasks import basic
# ============================================================================
# HelloWorld driver
class HelloWorld(basic.TaskDriver):
def run(self):
# put message
self.putMessage ( "Hello World!" )
# print in standard output and standard error streams
self.file_stdout.write ( "Hello World!\n" )
self.file_stderr.write ( "Hello World!\n" )
# process input data
if hasattr(self.input_data.data,"xyz"): # check if any data was chosen
xyz = self.input_data.data.xyz
self.putMessage ( "
Total " + str(len(xyz)) +\
" data objects chosen by user." )
for i in range(len(xyz)):
self.putMessage ( "Process dataset #" + str(i) + "" )
self.file_stdout.write (
"\n========= Data Object (metadata) #" + str(i) + "\n" +\
xyz[i].to_JSON() + "\n" )
xyzi = self.makeClass ( xyz[i] )
filepath = xyzi.getFilePath ( self.inputDir() )
filei = open ( filepath,'r' )
self.file_stdout.write (
"\n========= Data Content (file " + xyzi.files[0] +\
") #" + str(i) + "\n\n" + filei.read() + "\n" )
filei.close()
else:
self.putMessage ( "
No input data was chosen by user -- stop." )
# close execution logs and quit
self.success()
return
# ============================================================================
if __name__ == "__main__":
drv = HelloWorld ( "",os.path.basename(__file__) )
drv.run()
|
Download
this file and copy it in
pycofe/tasks
directories of all jsCoFE number crunchers, then create new
Hello World! task in a project with imported coordinate data. Run the task and
investigate which parts of Task Driver are responsible for which output
details. Note that this example is useful for learning actual metadata
structures of various data objects, while the present documentation may be
outdated or incomplete.


Wikipedia is a multilingual online encyclopedia, based on open collaboration through a wiki-based content editing system. It is the largest and most popular general reference work on the World Wide Web, and is one of the most popular websites ranked by Alexa as of June 2019. It features exclusively free content and no commercial ads, and is owned and supported by the Wikimedia Foundation, a non-profit organization funded primarily through donations.
Wikipedia was launched on January 15, 2001, by Jimmy Wales and Larry Sanger. Sanger coined its name, as a portmanteau of wiki (the Hawai'ian word for "quick"[14]) and "encyclopedia". Initially an English-language encyclopedia, versions in other languages were quickly developed. With 5,894,816 articles, the English Wikipedia is the largest of the more than 290 Wikipedia encyclopedias. Overall, Wikipedia comprises more than 40 million articles in 301 different languages and by February 2014 it had reached 18 billion page views and nearly 500 million unique visitors per month.
In 2005, Nature published a peer review comparing 42 hard science articles from Encyclopædia Britannica and Wikipedia and found that Wikipedia's level of accuracy approached that of Britannica, although critics suggested that it might not have fared so well in a similar study of a random sampling of all articles or one focused on social science or contentious social issues. The following year, Time magazine stated that the open-door policy of allowing anyone to edit had made Wikipedia the biggest and possibly the best encyclopedia in the world, and was a testament to the vision of Jimmy Wales.
Wikipedia has been criticized for exhibiting systemic bias, for presenting a mixture of "truths, half truths, and some falsehoods", and for being subject to manipulation and spin in controversial topics. However, Facebook announced that by 2017 it would help readers detect fake news by suggesting links to related Wikipedia articles. YouTube announced a similar plan in 2018.


tWLTH
The World Savings Vault on TRON
What is Commonwealth (tWLTH)?
Commonwealth is a global savings fund, and a P2P safety net. Whenever funds are deposited, a 10% dividend is paid proportionally and instantly to every holder. This micro-dividend is used to provide scalable, long term income stability to the group as a whole. tWLTH is a TRC20-compliant token and can be accepted and used as money.
What is the Commonwealth Vault?
The vault is the true market cap of Commonwealth, it is how much TRON is locked in the smart contract. The vault can never be changed, taken down, or modified. It is open source and verified on TronScan - we encourage public audit.
The Commonwealth vault only takes in TRON (TRX) and pays out TRX. If the price of TRX is $10 or $1000, the system will operate the same way. If the price of TRX goes up 10x, so will the price of tWLTH.
What is the maximum supply of tWLTH?
Technically, there is no ‘maximum supply’ of tWLTH - however, there is a ‘Current Supply’ - this is determined solely by how much TRX is stored in the contract, and it is impossible to create tWLTH without the appropriate amount of TRX to back it stored in the contract.
Why don't my tWLTH show in my wallet?
Commonwealth is a very new type of smart contract, which means sometimes it does not display perfectly with wallets. As long as you can see your funds on the official web wallet, they are safe.
What is the Price Floor?
The Price Floor contract is a smart contract that holds tWLTH. It can never sell, but it earns dividends when others buy or sell. It provides a guaranteed price floor. If you use Commonwealth on Ethereum Classic (ETC), you will know this feature as "RainMaker".
View Contract on TronScan
Can I trade tWLTH on JustSwap / DEXs?
tWLTH is not compatible with JustSwap, because while it is TRC20-compliant, the `transfer()` function has been modified to call "withdraw()", which means a UniSwap trade contract would end up with TRX that it doesn't know what to do with. This is because while the JustSwap contract would hold tokens, it too would also earn Dividends, and as such whenever the transfer function would be used by it in a trade, this problem of "stuck" TRX would occur.
In short: No. DEXs and those contracts do not understand the new technology of Commonwealth.gg - but they may eventually!


Oct 14, 2015 Meeting note
Notes
- there is no need to keep both laplacian and bi-laplacian in the same time if we add data-driven bias term.
- In the sketch figure, basically if we keep both terms and use weights to control the local behavior, it’s basically similar to use only one term with spatial-varying bias term.
- we can get two things from ground truth (and those are things that we can possibly infer from data), please see triangle in the figure:
- laplacian vector
- weights for weighted laplacian ($w_p$ and $w_n$)
And we have two strategies to tackle this problem:
- learn all those values (3 values in 2D, including 2-dim laplacian vector, and one scalar weight ($w_p+w_n=1.0$) ).
- only learn laplacian vector, and use alternative optimization to optimize $w_p$ and $w_n$.


“Yassa maggaṁ na jānāsi,
āgatassa gatassa vā;
Taṁ kuto cāgataṁ sattaṁ,
‘mama putto’ti rodasi.
“He whose path you do not know,
not whence he came nor where he went;
though he came from who knows where,
you mourn that being, crying, ‘Oh my son!’
Maggañca khossa jānāsi,
āgatassa gatassa vā;
Na naṁ samanusocesi,
evaṁdhammā hi pāṇino.
But one whose path you do know,
whence they came or where they went;
that one you do not lament—
such is the nature of living creatures.
Ayācito tatāgacchi,
nānuññāto ito gato;
Kutoci nūna āgantvā,
vasitvā katipāhakaṁ;
Itopi aññena gato,
tatopaññena gacchati.
Unasked he came,
he left without leave.
He must have come from somewhere,
and stayed who knows how many days.
He left from here by one road,
he will go from there by another.
Peto manussarūpena,
saṁsaranto gamissati;
Yathāgato tathā gato,
kā tattha paridevanā”.
Departing with the form of a human,
he will go on transmigrating.
As he came, so he went:
why cry over that?”
“Abbahī vata me sallaṁ,
duddasaṁ hadayassitaṁ;
Yā me sokaparetāya,
puttasokaṁ byapānudi.
“Oh! For you have plucked the dart from me,
so hard to see, hidden in the heart.
You’ve swept away the grief for my son,
in which I once was mired.
Sājja abbūḷhasallāhaṁ,
Nicchātā parinibbutā;
Buddhaṁ dhammañca saṅghañca,
Upemi saraṇaṁ muniṁ”.
Today I’ve plucked the dart,
I’m hungerless, extinguished.
I go for refuge to that sage, the Buddha,
to his teaching, and to the Sangha.”
Itthaṁ sudaṁ pañcasatamattā therī bhikkhuniyo …
pe….
It was thus that Paṭācārā, who had a following of five hundred, declared her enlightenment.


A New Look for the EH Data Portal
We’ve made a few changes
If you’re a regular to the Environment & Health Data Portal, then you may notice that we’ve made a few changes to our home page. We’ve kept most of the Portal’s functions the same, but we’ve rearranged things, and want to tell you about them.
Before
After
Why’d we make these changes?
Well, for a few reasons:
To highlight our best tools and resources. We want our home page to make it clear what this site is all about, and draw attention to our top tools: our Data Explorer, Neighborhood Reports, and Data Stories. By bringing these to the top, we’re showing what we want our visitors to do here.
To incorporate new content. Over the coming months, we’ll be producing more Data Stories on critical issues in environmental health in New York City. These Data Stories will take deep dives into our data, investigating important issues that affect health in New York City. Some of these will be essays, some of them will be interactive infographics. For now, take a look at “A Closer Look” on our homepage – or find them all at Data Stories.
To improve accessibility. Our new Home Page works a lot better on mobile, but it also works better for users who are visually impaired or navigate using their keyboard. Ensuring accessibility for all users – by meeting what are called Section 508 Standards – we’re working toward information equity: ensuring that all users can access the information that we’re producing.
To meet modern standards. On the internet, sometimes looks matter. We hope to stay abreast of modern design and technology standards so that we can do a good job of making information available to you. That means taking advantage of open source projects, user-centered design, analytics, and user feedback to make sure that we’re building a system that works: that’s intuitive and makes our information clear and easy-to-find.
We’re a government agency committed to making information available via the web. We hope that the better we are at doing this, the more people can use this information to make change in their lives, their neighborhoods, and communities.
We have more changes coming down the pipeline. If you’d like to be a part and provide input on how our Data Portal functions, feel free to contact us.


A clock-style timepicker for Bootstrap (or jQuery).
Download ZIP CSS < 6KB, JS < 9KB, after minified.
This is the non-bootstrap documentation page.
All major browsers are supported, including IE 9+. It should look and behave well enough in IE 8.
Both desktop and mobile device are supported. It also works great in touch screen device.
ClockPicker was designed for Bootstrap in the beginning. So Bootstrap (and jQuery) is the only dependency(s).
Since it only used .popover
and some of .btn
styles of Bootstrap, I picked these styles to build a jQuery plugin.
Feel free to use jquery-*
files instead of bootstrap-*
, for non-bootstrap project.
See ClockPicker for Bootstrap.

<input type="text" class="form-control" value="09:30">

<input type="text" class="form-control" value="13:14">

data-*
:

<input type="text" class="form-control" value="18:00">

<input type="text" class="form-control" id="single-input" value="" placeholder="现在">

<input class="form-control" id="single-input" value="" placeholder="Now">

| Name | Default | Description |
|---|---|---|
| default | '' | default time, '13:14' e.g. |
| placement | 'bottom' | popover placement |
| align | 'left' | popover arrow align |
| donetext | '完成' | done button text |
| autoclose | false | auto close when minute is selected |
| vibrate | true | vibrate the device when dragging clock hand |
| init | callback function triggered after the colorpicker has been initiated | |
| beforeShow | callback function triggered before popup is shown | |
| afterShow | callback function triggered after popup is shown | |
| beforeHide | callback function triggered before popup is hidden Note: will be triggered between a beforeDone and afterDone |
|
| afterHide | callback function triggered after popup is hidden Note: will be triggered between a beforeDone and afterDone |
|
| beforeHourSelect | callback function triggered before user makes an hour selection | |
| afterHourSelect | callback function triggered after user makes an hour selection | |
| beforeDone | callback function triggered before time is written to input | |
| afterDone | callback function triggered after time is written to input |
clockpicker/
├── dist/
│ ├── bootstrap-clockpicker.css # full code for bootstrap
│ ├── bootstrap-clockpicker.js
│ ├── bootstrap-clockpicker.min.css # compiled and minified files for bootstrap
│ ├── bootstrap-clockpicker.min.js
│ ├── jquery-clockpicker.css # full code for jquery
│ ├── jquery-clockpicker.js
│ ├── jquery-clockpicker.min.css # compiled and minified files for jquery
│ └── jquery-clockpicker.min.js
└── src/ # source code
├── clockpicker.css
├── clockpicker.js
└── standalone.css # some styles picked from bootstrap
MIT


Component: tos.platforms.mica.HilTimerMilliC
configuration HilTimerMilliC
Millisecond timer for the mica family (see TEP102). The "millisecond"
timer system is built on hardware timer 0, running at 1024Hz.
- Author:
-
Cory Sharp<EMAIL_ADDRESS>-
Martin Turon<EMAIL_ADDRESS>Provides
interface
Timer<TMilli> as
TimerMilli[uint8_t]
Wiring


Sorry, your browser does not support HTML5 audio.
Ravel Bolero
Moonlight Sonata - Beethoven
Canon in D Pachabel
patrikbkarl chamber symph
MNML
It's website building timey!


Sources¶
CreditEAI Procedure
CreditEAI transactions are issued by active nodes and each causes all accounts delegated to that node to have their accrued EAI credited, provided they are not currently on the BPC list of accounts forfeiting EAI. and each includes a list of accounts to which accrued EAI is to be credited.
The transaction is not valid if it lists an account not delegated to the node submitting it, or if it lists an account currently listed in the BPC’s “forfeited EAI” blacklist.
The CreditEAI transaction fee includes a per-byte component, discouraging nodes from listing accounts more often than necessary.
There are two applicable CreditEAI limits published on the chaos chain: a maximum elapsed time and a maximum accrued amount. Nodes are responsible for crediting EAI to each account with sufficient frequency to not exceed either of those limits.
If those limits are exceeded, the next CreditEAI transaction will credit the amount accrued as if the most recent CreditEAI transaction had occurred at the oldest time that would not have exceeded either of them.
There is no minimum elapsed time between credits to any given account, nor is there a minimum amount to be credited. Nodes and accounts are penalized for too-frequent credits: the node pays unnecessary fees, and the account loses more EAI due to truncation.
No accrued EAI is lost if an account is redelegated to a new node. The next CreditEAI transaction issued by the new node will credit all accrued EAI due, subject to the time and quantity limits listed in #5 above.
EAI Rate Schedule Changes
EAI accrues based on an account’s WAA according to the EAI rate table currently in effect. An account’s WAA is updated on every incoming transfer to it: outgoing transfers and EAI credits do not update the WAA.
When an account is locked, the current EAI lock bonus for the specified lock period is recorded as part of the account state. That lock bonus never changes and is always added to the current unlocked base rate, which may change.
EAI is accrued by a locked account at the current base rate applicable to its current WAA plus the lock bonus rate recorded when the account was locked.
Changes to the unlocked EAI rate tables take effect immediately. All accounts begin accruing EAI at the new rates. Locked accounts continue to have their original EAI bonus amount added to the current unlocked rate.
If an account is re-locked its bonus is changed to the then-current rate for the new lock period.
Node Reward Procedure
An off-chain service (initially operated by ndev) periodically issues NominateNodeReward transactions. The chaos chain identifies the accounts permitted to issue this transaction, and it lists a table of EAI fees to be allocated to system accounts and node rewards.
System EAI fees due to all listed recipients are calculated in the NominateNodeReward transaction and credited to the appropriate system accounts. The transaction also calculates the amount available to be claimed in the node reward itself and publishes it in the transaction but does not credit it to that node.
The nominated node must respond within a time limit (published on the chaos chain) by issuing a ClaimNodeReward transaction.
The ClaimNodeReward transaction must be issued by the nominated node, and it credits the node reward specified in the nomination to it.
The NominateNodeReward transaction calculates all fee and reward amounts accrued since the last NominateNodeReward transaction. If the previous node reward was not claimed in time, it is discarded.


Buckets can be vulnerable to privilege escalation through misconfigured bucket ACLs (also see here).
We can check for the bucket's policy by making direct HTTP requests to:
https://www.googleapis.com/storage/v1/b/BUCKET_NAME/iam
or use the gsutil CLI to run:
gsutil iam get gs://BUCKET_NAME
if "allUsers" or "allAuthenticatedUsers" are allowed to read the bucket policy, we will receive a valid response. Else, access denied.
Bucket policy is helpful, but requires the "storage.buckets.getIamPolicy" permission. We can test permissions explicity with the Google Storage "TestIamPermissions" API. If we supply a bucket name and list Google Storage permissions, it will respond with the permissions we (the user making the request) have on that bucket. This completely bypasses the requirement of viewing the policy, with the restriction we can only view permissions for users we are able to authenticate as.
To determine what permissions we have on a bucket, we can make a request to a URL similar to:
https://www.googleapis.com/storage/v1/b/BUCKET_NAME/iam/testPermissions?permissions=storage.objects.list
It will respond and let us know if we have the "storage.objects.list" permission on the "BUCKET_NAME". The permissions parameter can be passed multiple times to check multiple permissions at once, and the Google Storage Python library supports the test_iam_permissions API (even though "gsutil" does not).
One privilege escalation method requires the "storage.buckets.setIamPolicy" permission.
A vulnerable bucket policy might look something like this:
{"bindings":[{"members":["allAuthenticatedUsers","projectEditor:my-test-project","projectOwner:my-test-project"],"role":"roles\/storage.legacyBucketOwner"},{"members":["projectViewer:my-test-project"],"role":"roles\/storage.legacyBucketReader"},{"members":["projectEditor:my-test-project","projectOwner:my-test-project"],"role":"roles\/storage.legacyObjectOwner"},{"members":["projectViewer:my-test-project"],"role":"roles\/storage.legacyObjectReader"}],"etag":"ROQ="}
Note: The “gsutil iam ch” command requires permission to read the target bucket’s policy, because it first reads the policy, then adds your addition to it, then writes the new policy. You might not always have this permission, even if you have the SetBucketPolicy permission. In those cases, you would need to overwrite the existing policy and risk causing errors in their environment, such as if you accidentally revoke access from something that needs it.


Just press the Start button to analyze the input of microphone.
More the thresold is high more the BPM is stable (in theory).
Thresold: 0
BPM: - (0)
BPM: - (0)
GitHub exemple repository https://github.com/dlepaux/realtime-bpm-analyzer-exemple
GitHub library repository https://github.com/dlepaux/realtime-bpm-analyzer


Web Series
Narcos
Biography,Action
IMDB: 8.8/10
Ratings:
Stranger Things
Sci-Fi,Occult Fiction
IMDB: 8.9/10
Ratings:
Game of Thrones
Drama,Action,Thriller
IMDB: 9.5/10
Ratings:
Movies
The Walk
Adventure, Biography, Drama
IMDB: 7.3/10
Ratings:
The Wolf Of Wall Street
Biography, Crime, Drama
IMDB: 8.2/10
Ratings:
21 Jump Street
Action, Comedy, Crime
IMDB: 7.2/10
Ratings:
Cartoons
Phineas And Ferb
Animation, Action, Comedy
IMDB: 8.0/10
Ratings:
Rick and Morty
Animation, Adventure, Comedy
IMDB: 9.3/10
Ratings:
Tom and Jerry
Animation, Family, Comedy
IMDB: 7.9/10
Ratings:
Featured Events
CLC Stand Up Comedy
Place: Mumbai & Pune
YouTube FanFest
Place: Bangalore


If this checkbox is selected, IntelliJ IDEA automatically inserts an import statement
in JavaScript code when you complete a symbol exported using ES6 exports in another project file:
When the checkbox is cleared, on pressing Alt+Enter IntelliJ IDEA shows a popup that suggests to import
the symbol:
Completion and auto-import also work for React components, including stateless components. IntelliJ IDEA properly
detects them, provides code completion, and adds import statements automatically:


&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;
[NOTE: Serrin prepared this “thank you” email for you earlier in the week. Thursday
morning her mother suffered a major heart attack and is currently hospitalized.
While Serrin very much appreciates all of the well-wishes you may send on behalf
of her 20th anniversary, she hopes you’ll understand if she is unable to respond
quickly. Thank you, Sally]
Donna & Serrin
&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;
04.04.14
&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;
Dear Dry,
I remember when I first saw the ad for a job with Feminists for Life and knowing
I have to do this job. Everything in my life prepared me for this position.
I remember the first FFL members who interviewed me, and thinking I’M HOME.
I remember those key people in my life who helped me along the way, most especially
my late father who was a student parent and my mother who was an early pregnancy
resource center volunteer and who inspired my first speech in college against abortion.
I am grateful to our feminist foremothers, our cofounders, board members, staff,
interns, speakers, volunteers, past and present-and the members and donors who
fueled our efforts made possible because you believe in our mission, message and
solutions.
You have given up weekends and evenings, and money that you could have used for
a night out, a vacation, or something else.
You have risked being ostracized by family, friends, other students and coworkers
in a day when it was not popular to be a known as a feminist or pro-life.
Rather than run from the term, people now argue about who is a real feminist. We
have educated millions about our rich-pro-life feminist history.
Because of your sacrifice we have shared the truth: Women Deserve Better® than Abortion.
One major party uses that FFL slogan in its platform. Another major party talks
about resources and support. Our job now is to put the message together with the
meaning-to listen to women, to share successful strategies, to ensure women have
what they need, and to make abortion unthinkable.
I celebrate the legislation and programs that we have helped make possible for the
poor-including the working poor, pregnant women and parents who are in school, the
workplace or at home, birthmothers, and our student activists whom we empower to
carry on our revolution through FFL’s flagship College Outreach Program.
I thank you for trusting me with your darkest secrets and terrible losses and for
sharing your greatest joys. I treasure your notes that accompany your gifts. I am
humbled by the opportunity of a lifetime to represent Feminists for Life.
The Board of Directors-and you-could not give a better gift than to fund FFL so
that the staff has the resources to make life better for women and children.
Many victories have been won; however, the one source of ongoing struggle and sleepless
nights for me has been to think of the first-class initiatives Feminists For Life
could put into action faster and further if only we had the funding.
How many more women would experience great joy instead of fear, shame and loss?
How many more fathers would be supportive of mothers and children?
How many more birthmothers would find adoption as an empowering option?
How many children would be here with us now?
I thank the Board for their $5,000 leadership gift in honor of my 20th anniversary
- given over and above their ongoing donations - and I thank you for joining this
celebration.
Today is truly our 20th anniversary because FFL always has been a team effort. I
urge you to multiply our impact by inviting others to our movement.
In closing, as we look back over the past twenty years of achievements at Feminists
for Life, our gaze must be firmly focused on the future - most especially on the
women and children who will have a future, a better future, because of the sacrifices
we make today.
March forth.
Because women deserve better,
Serrin M. Foster
President
&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;&;
Forward this email
<EMAIL_ADDRESS>This email was sent to<EMAIL_ADDRESS>by<EMAIL_ADDRESS>Update Profile/Email Address
http://visitor.constantcontact.com/do?p=oo&m=001Q-HkL4DKCBRaE4RH1EOTXw%3D%3D&ch=5af11d60-4f61-11e3-9d28-d4ae5275dbea&ca=5c4503fb-ee7e-4d49-8409-3f1475790a87
Instant removal with SafeUnsubscribe™
http://visitor.constantcontact.com/do?p=un&m=001Q-HkL4DKCBRaE4RH1EOTXw%3D%3D&ch=5af11d60-4f61-11e3-9d28-d4ae5275dbea&ca=5c4503fb-ee7e-4d49-8409-3f1475790a87
Privacy Policy:
http://ui.constantcontact.com/roving/CCPrivacyPolicy.jsp
Online Marketing by
Constant Contact®
www.constantcontact.com
Feminists for Life | P.O. Box 320667 | Alexandria | VA | 22320


Wrap into a form, validation, have a direct submit form and display the record
Direct submit forms means, it sends data right away to the videomail.io server. But
if you prefer to submit to your own server, look at the other example
contact_form.html.


Nathan Harker
Menu
Home
About Me
Education
Experience
Service
Skills
Projects
Contact
Experience
This is what I've done.
Brigham Young University -
Education Advisement Center
,
Advisement Assistant
(Aug 2019 - Present)
Advised over 1,000 students in discovering and framing their journey towards graduation and UT state education licensure
Performed overhaul on center’s records system with Excel VBA, increasing the speed and accuracy of reports by over 50%
Battaglia Capital
,
Market Strategy Intern
(May 2020 - Aug 2020)
Analyzed data and built Tableau visualizations to predict industry growth and validate market strategies
Created the firm’s flagship company’s comprehensive market entry plan, anticipated to generate $3.4M in yearly revenue from exports to the US
Cougar Consulting Group
,
Analysis Specialist
(Jan 2020 - Apr 2020)
Advised $700M language learning software firm as they pursued a larger market share in a target region
Produced an attribute importance and performance analysis to identify potential issues attendant to current product offering
Performed customer segment analyses to provide recommendations on the most lucrative customer segments to target
Neighbor Storage
,
Growth Strategy Intern
(Apr 2019 - Jul 2019)
Developed a new customer acquisition system that resulted in over 500 new users and increased Neighbor’s yearly bottom line by over $30,000
Coordinated various interviews for the company CEO on radio shows, podcasts, and television outlets
Helped design and execute a PR launch for firm’s referral program which resulted in over 4 million potential impressions
Survey Sampling International
,
Survey Sampling Agent
(Oct 2018 - Dec 2018, Aug 2016 - Oct 2016)
Exceeded target production rate for center agents on all projects
Trained on Edward Jones and Thrivent customer satisfaction evaluation projects
Rexburg Rapids at Riverside Park
,
Head Lifeguard
(Apr 2013 - Sep 2016)
Decreased accident rate by 75% through prevention training and redesigned supervision
American Red Cross certified in CPR, AED, First Aid, Lifeguard, LGI, WSI
Trained over 200 swimmers to advance in American Red Cross skill classifications as WSI


# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # import uuid from typing import Optional, Dict, List from abc import ABC, abstractmethod from py4j.java_gateway import JavaObject from pyspark.sql import Row from pyspark import cloudpickle __all__ = ["StreamingQueryListener"] [docs]class StreamingQueryListener(ABC): """ Interface for listening to events related to :class:`~pyspark.sql.streaming.StreamingQuery`. .. versionadded:: 3.4.0 Notes ----- The methods are not thread-safe as they may be called from different threads. The events received are identical with Scala API. Refer to its documentation. This API is evolving. Examples -------- >>> class MyListener(StreamingQueryListener): ... def onQueryStarted(self, event: QueryStartedEvent) -> None: ... # Do something with event. ... pass ... ... def onQueryProgress(self, event: QueryProgressEvent) -> None: ... # Do something with event. ... pass ... ... def onQueryTerminated(self, event: QueryTerminatedEvent) -> None: ... # Do something with event. ... pass ... >>> spark.streams.addListener(MyListener()) """ @abstractmethod def onQueryStarted(self, event: "QueryStartedEvent") -> None: """ Called when a query is started. Notes ----- This is called synchronously with :py:meth:`~pyspark.sql.streaming.DataStreamWriter.start`, that is, `onQueryStart` will be called on all listeners before `DataStreamWriter.start()` returns the corresponding :class:`~pyspark.sql.streaming.StreamingQuery`. Please don't block this method as it will block your query. """ pass @abstractmethod def onQueryProgress(self, event: "QueryProgressEvent") -> None: """ Called when there is some status update (ingestion rate updated, etc.) Notes ----- This method is asynchronous. The status in :class:`~pyspark.sql.streaming.StreamingQuery` will always be latest no matter when this method is called. Therefore, the status of :class:`~pyspark.sql.streaming.StreamingQuery`. may be changed before/when you process the event. E.g., you may find :class:`~pyspark.sql.streaming.StreamingQuery` is terminated when you are processing `QueryProgressEvent`. """ pass @abstractmethod def onQueryTerminated(self, event: "QueryTerminatedEvent") -> None: """ Called when a query is stopped, with or without error. """ pass @property def _jlistener(self) -> JavaObject: from pyspark import SparkContext if hasattr(self, "_jlistenerobj"): return self._jlistenerobj self._jlistenerobj: JavaObject = ( SparkContext._jvm.PythonStreamingQueryListenerWrapper( # type: ignore[union-attr] JStreamingQueryListener(self) ) ) return self._jlistenerobj class JStreamingQueryListener: """ Python class that implements Java interface by Py4J. """ def __init__(self, pylistener: StreamingQueryListener) -> None: self.pylistener = pylistener def onQueryStarted(self, jevent: JavaObject) -> None: self.pylistener.onQueryStarted(QueryStartedEvent(jevent)) def onQueryProgress(self, jevent: JavaObject) -> None: self.pylistener.onQueryProgress(QueryProgressEvent(jevent)) def onQueryTerminated(self, jevent: JavaObject) -> None: self.pylistener.onQueryTerminated(QueryTerminatedEvent(jevent)) class Java: implements = ["org.apache.spark.sql.streaming.PythonStreamingQueryListener"] class QueryStartedEvent: """ Event representing the start of a query. .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jevent: JavaObject) -> None: self._id: uuid.UUID = uuid.UUID(jevent.id().toString()) self._runId: uuid.UUID = uuid.UUID(jevent.runId().toString()) self._name: Optional[str] = jevent.name() self._timestamp: str = jevent.timestamp() @property def id(self) -> uuid.UUID: """ A unique query id that persists across restarts. See py:meth:`~pyspark.sql.streaming.StreamingQuery.id`. """ return self._id @property def runId(self) -> uuid.UUID: """ A query id that is unique for every start/restart. See py:meth:`~pyspark.sql.streaming.StreamingQuery.runId`. """ return self._runId @property def name(self) -> Optional[str]: """ User-specified name of the query, `None` if not specified. """ return self._name @property def timestamp(self) -> str: """ The timestamp to start a query. """ return self._timestamp class QueryProgressEvent: """ Event representing any progress updates in a query. .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jevent: JavaObject) -> None: self._progress: StreamingQueryProgress = StreamingQueryProgress(jevent.progress()) @property def progress(self) -> "StreamingQueryProgress": """ The query progress updates. """ return self._progress class QueryTerminatedEvent: """ Event representing that termination of a query. .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jevent: JavaObject) -> None: self._id: uuid.UUID = uuid.UUID(jevent.id().toString()) self._runId: uuid.UUID = uuid.UUID(jevent.runId().toString()) jexception = jevent.exception() self._exception: Optional[str] = jexception.get() if jexception.isDefined() else None @property def id(self) -> uuid.UUID: """ A unique query id that persists across restarts. See py:meth:`~pyspark.sql.streaming.StreamingQuery.id`. """ return self._id @property def runId(self) -> uuid.UUID: """ A query id that is unique for every start/restart. See py:meth:`~pyspark.sql.streaming.StreamingQuery.runId`. """ return self._runId @property def exception(self) -> Optional[str]: """ The exception message of the query if the query was terminated with an exception. Otherwise, it will be `None`. """ return self._exception class StreamingQueryProgress: """ .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jprogress: JavaObject) -> None: from pyspark import SparkContext self._jprogress: JavaObject = jprogress self._id: uuid.UUID = uuid.UUID(jprogress.id().toString()) self._runId: uuid.UUID = uuid.UUID(jprogress.runId().toString()) self._name: Optional[str] = jprogress.name() self._timestamp: str = jprogress.timestamp() self._batchId: int = jprogress.batchId() self._batchDuration: int = jprogress.batchDuration() self._durationMs: Dict[str, int] = dict(jprogress.durationMs()) self._eventTime: Dict[str, str] = dict(jprogress.eventTime()) self._stateOperators: List[StateOperatorProgress] = [ StateOperatorProgress(js) for js in jprogress.stateOperators() ] self._sources: List[SourceProgress] = [SourceProgress(js) for js in jprogress.sources()] self._sink: SinkProgress = SinkProgress(jprogress.sink()) self._observedMetrics: Dict[str, Row] = { k: cloudpickle.loads( SparkContext._jvm.PythonSQLUtils.toPyRow(jr) # type: ignore[union-attr] ) for k, jr in dict(jprogress.observedMetrics()).items() } @property def id(self) -> uuid.UUID: """ A unique query id that persists across restarts. See py:meth:`~pyspark.sql.streaming.StreamingQuery.id`. """ return self._id @property def runId(self) -> uuid.UUID: """ A query id that is unique for every start/restart. See py:meth:`~pyspark.sql.streaming.StreamingQuery.runId`. """ return self._runId @property def name(self) -> Optional[str]: """ User-specified name of the query, `None` if not specified. """ return self._name @property def timestamp(self) -> str: """ The timestamp to start a query. """ return self._timestamp @property def batchId(self) -> int: """ A unique id for the current batch of data being processed. Note that in the case of retries after a failure a given batchId my be executed more than once. Similarly, when there is no data to be processed, the batchId will not be incremented. """ return self._batchId @property def batchDuration(self) -> int: """ The process duration of each batch. """ return self._batchDuration @property def durationMs(self) -> Dict[str, int]: """ The amount of time taken to perform various operations in milliseconds. """ return self._durationMs @property def eventTime(self) -> Dict[str, str]: """ Statistics of event time seen in this batch. It may contain the following keys: .. code-block:: python { "max": "2016-12-05T20:54:20.827Z", # maximum event time seen in this trigger "min": "2016-12-05T20:54:20.827Z", # minimum event time seen in this trigger "avg": "2016-12-05T20:54:20.827Z", # average event time seen in this trigger "watermark": "2016-12-05T20:54:20.827Z" # watermark used in this trigger } All timestamps are in ISO8601 format, i.e. UTC timestamps. """ return self._eventTime @property def stateOperators(self) -> List["StateOperatorProgress"]: """ Information about operators in the query that store state. """ return self._stateOperators @property def sources(self) -> List["SourceProgress"]: """ detailed statistics on data being read from each of the streaming sources. """ return self._sources @property def sink(self) -> "SinkProgress": """ A unique query id that persists across restarts. See py:meth:`~pyspark.sql.streaming.StreamingQuery.id`. """ return self._sink @property def observedMetrics(self) -> Dict[str, Row]: return self._observedMetrics @property def numInputRows(self) -> Optional[str]: """ The aggregate (across all sources) number of records processed in a trigger. """ return self._jprogress.numInputRows() @property def inputRowsPerSecond(self) -> str: """ The aggregate (across all sources) rate of data arriving. """ return self._jprogress.inputRowsPerSecond() @property def processedRowsPerSecond(self) -> str: """ The aggregate (across all sources) rate at which Spark is processing data.. """ return self._jprogress.processedRowsPerSecond() @property def json(self) -> str: """ The compact JSON representation of this progress. """ return self._jprogress.json() @property def prettyJson(self) -> str: """ The pretty (i.e. indented) JSON representation of this progress. """ return self._jprogress.prettyJson() def __str__(self) -> str: return self.prettyJson class StateOperatorProgress: """ .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jprogress: JavaObject) -> None: self._jprogress: JavaObject = jprogress self._operatorName: str = jprogress.operatorName() self._numRowsTotal: int = jprogress.numRowsTotal() self._numRowsUpdated: int = jprogress.numRowsUpdated() self._allUpdatesTimeMs: int = jprogress.allUpdatesTimeMs() self._numRowsRemoved: int = jprogress.numRowsRemoved() self._allRemovalsTimeMs: int = jprogress.allRemovalsTimeMs() self._commitTimeMs: int = jprogress.commitTimeMs() self._memoryUsedBytes: int = jprogress.memoryUsedBytes() self._numRowsDroppedByWatermark: int = jprogress.numRowsDroppedByWatermark() self._numShufflePartitions: int = jprogress.numShufflePartitions() self._numStateStoreInstances: int = jprogress.numStateStoreInstances() self._customMetrics: Dict[str, int] = dict(jprogress.customMetrics()) @property def operatorName(self) -> str: return self._operatorName @property def numRowsTotal(self) -> int: return self._numRowsTotal @property def numRowsUpdated(self) -> int: return self._numRowsUpdated @property def allUpdatesTimeMs(self) -> int: return self._allUpdatesTimeMs @property def numRowsRemoved(self) -> int: return self._numRowsRemoved @property def allRemovalsTimeMs(self) -> int: return self._allRemovalsTimeMs @property def commitTimeMs(self) -> int: return self._commitTimeMs @property def memoryUsedBytes(self) -> int: return self._memoryUsedBytes @property def numRowsDroppedByWatermark(self) -> int: return self._numRowsDroppedByWatermark @property def numShufflePartitions(self) -> int: return self._numShufflePartitions @property def numStateStoreInstances(self) -> int: return self._numStateStoreInstances @property def customMetrics(self) -> Dict[str, int]: return self._customMetrics @property def json(self) -> str: """ The compact JSON representation of this progress. """ return self._jprogress.json() @property def prettyJson(self) -> str: """ The pretty (i.e. indented) JSON representation of this progress. """ return self._jprogress.prettyJson() def __str__(self) -> str: return self.prettyJson class SourceProgress: """ .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jprogress: JavaObject) -> None: self._jprogress: JavaObject = jprogress self._description: str = jprogress.description() self._startOffset: str = jprogress.startOffset() self._endOffset: str = jprogress.endOffset() self._latestOffset: str = jprogress.latestOffset() self._numInputRows: int = jprogress.numInputRows() self._inputRowsPerSecond: float = jprogress.inputRowsPerSecond() self._processedRowsPerSecond: float = jprogress.processedRowsPerSecond() self._metrics: Dict[str, str] = dict(jprogress.metrics()) @property def description(self) -> str: """ Description of the source. """ return self._description @property def startOffset(self) -> str: """ The starting offset for data being read. """ return self._startOffset @property def endOffset(self) -> str: """ The ending offset for data being read. """ return self._endOffset @property def latestOffset(self) -> str: """ The latest offset from this source. """ return self._latestOffset @property def numInputRows(self) -> int: """ The number of records read from this source. """ return self._numInputRows @property def inputRowsPerSecond(self) -> float: """ The rate at which data is arriving from this source. """ return self._inputRowsPerSecond @property def processedRowsPerSecond(self) -> float: """ The rate at which data from this source is being processed by Spark. """ return self._processedRowsPerSecond @property def metrics(self) -> Dict[str, str]: return self._metrics @property def json(self) -> str: """ The compact JSON representation of this progress. """ return self._jprogress.json() @property def prettyJson(self) -> str: """ The pretty (i.e. indented) JSON representation of this progress. """ return self._jprogress.prettyJson() def __str__(self) -> str: return self.prettyJson class SinkProgress: """ .. versionadded:: 3.4.0 Notes ----- This API is evolving. """ def __init__(self, jprogress: JavaObject) -> None: self._jprogress: JavaObject = jprogress self._description: str = jprogress.description() self._numOutputRows: int = jprogress.numOutputRows() self._metrics: Dict[str, str] = dict(jprogress.metrics()) @property def description(self) -> str: """ Description of the source. """ return self._description @property def numOutputRows(self) -> int: """ Number of rows written to the sink or -1 for Continuous Mode (temporarily) or Sink V1 (until decommissioned). """ return self._numOutputRows @property def metrics(self) -> Dict[str, str]: return self._metrics @property def json(self) -> str: """ The compact JSON representation of this progress. """ return self._jprogress.json() @property def prettyJson(self) -> str: """ The pretty (i.e. indented) JSON representation of this progress. """ return self._jprogress.prettyJson() def __str__(self) -> str: return self.prettyJson def _test() -> None: import sys import doctest import os from pyspark.sql import SparkSession import pyspark.sql.streaming.listener from py4j.protocol import Py4JError os.chdir(os.environ["SPARK_HOME"]) globs = pyspark.sql.streaming.listener.__dict__.copy() try: spark = SparkSession._getActiveSessionOrCreate() except Py4JError: # noqa: F821 spark = SparkSession(sc) # type: ignore[name-defined] # noqa: F821 globs["spark"] = spark (failure_count, test_count) = doctest.testmod( pyspark.sql.streaming.listener, globs=globs, ) globs["spark"].stop() if failure_count: sys.exit(-1) if __name__ == "__main__": _test()


@@include('./head.html')
@@include('./header.html')Here, you can access advice and information about the different types of services we offer. You can also understand more about our partnerships, projects and campaigns, find out how you can stay safe and get the help and support you need if you’ve been affected by crime.
Wildlife and animal crime can be a complex area. Animal cruelty occurs when someone doesn’t care for or deliberately hurts an animal. It includes physical violence, not feeding or cleaning an animal, deliberate mental distress or neglect. We work with the RSPCA to investigate cases of animal cruelty.
If you see or suspect that an animal is being mistreated or neglected, please report this to the RSPCA’s 24-hour cruelty line.
If anyone under the age of 18 is either being harmed or not being properly looked after, it constitutes child abuse.  We can help you find out more about each of these categories, as well as figure out the warning signs if a child is being abused, what you can do if you are worried about the safety and well-being of a child and different ways you can get in touch.
If you suspect someone is in immediate danger, call us on 999 now.
Domestic abuse affects people in many different ways. We can help you to find out what is classified as domestic abuse, how you can report it and even find out if a person has a history of domestic violence or abuse. We focus on protecting you and any children you have as our priority.
If you are a victim of domestic abuse, or know someone who is, please call 999 now.
For some events and processions held each year across the country, the law requires organisers to notify us in advance. Whether it’s a festival, show, demonstration or a march, we work with the community to make sure things work as planned. For different events and processions, we undertake risk assessments and look at ways of preventing breaches of peace and minimising serious disruption to the wider community. You can find out about how we help in the planning and policing of events and, if you’re organising an event, whether you need to notify us.
With your help, we can deal with those responsible for hate crime and help to keep you and your communities safe. Hate crime can hit communities in different ways. We're here and ready to help if anyone has been affected by prejudice, ignorance or violence.
You can help to spot a hate crime, report it, or get help, support and advice – both online and in your community.
Neighbourhood Watch is about people getting together with their neighbours to take action to reduce crime. Pub Watch schemes are local, independent groups formed of people working in licensed premises, while Country Watch schemes connect those living and working in rural parts of the country. Many of these schemes help us to cut crime and the opportunities for crime; they help and reassure those who live in the area and encourage neighbourliness and closer communities.
You can contact your local Watch Administrator for more information on how these schemes work, the benefits of the schemes and advice on running a scheme in your local area.


Toggle navigation
Health Keeper
Personal data
Logout
Login
Sign in
Invalid username and password.
You have been logged out.
Sign in


|
XNLO - UPPE
1.3.0
Unidirectional Pulse Propagation Equation
|
#include <grid_tw.hpp>
Public Member Functions | |
| grid_tw () | |
| grid_tw (int N_t_, double T_, double w_active_min_, double w_active_max_, maths_textbook &maths_) | |
Public Attributes | |
| ArrayXd | t |
| ArrayXd | w_active |
| int | n_t |
| int | n_active |
| int | w_active_min_index |
Originally created by Patrick Anderson. Modified by Samuel Senior on 10/03/2017. "grid_tw" is a linear temporal grid. The spectral counterpart of this grid is evaluated and made accessible.
| grid_tw::grid_tw | ( | ) |
| grid_tw::grid_tw | ( | int | n_t_, |
| double | T_, | ||
| double | w_active_min_, | ||
| double | w_active_max_, | ||
| maths_textbook & | maths_ | ||
| ) |
Parameterized Constructor
| int grid_tw::n_active |
| int grid_tw::n_t |
| ArrayXd grid_tw::t |
| ArrayXd grid_tw::w_active |
| int grid_tw::w_active_min_index |


Prints the active worksheet using methods compatible with those of Lotus 1-2-3. LINE.PRINT does not use the Microsoft Windows printer drivers. Unless you have a specific need for the LINE.PRINT function, use the PRINT function instead.
Note This function is only available in Microsoft Excel for Windows.
Syntax 1
Go, Line, Page, Align, and Clear
LINE.PRINT(command, file, append)
Syntax 2
Worksheet settings
LINE.PRINT(command, setup_text, leftmarg, rightmarg, topmarg, botmarg, pglen, formatted)
Syntax 3
Global settings
LINE.PRINT(command, setup_text, leftmarg, rightmarg, topmarg, botmarg, pglen, wait, autolf, port, update)
Command is a number corresponding to the command you want LINE.PRINT to carry out. For syntax 2, command must be 5. For syntax 3, command must be 6.
| Command | Command that is carried out |
| 1 | Go |
| 2 | Line |
| 3 | Page |
| 4 | Align |
| 5 | Worksheet settings |
| 6 | Global settings (saved in EXCEL5.INI) |
| 7 | Clear (change to current global settings) |
File is the name of a file to which you want to print. If omitted, Microsoft Excel prints to the printer port determined by the current global settings.
Append is a logical value specifying whether to append text to file. If TRUE, the file you are printing is appended to file; if FALSE or omitted, the file you are printing overwrites the contents of file.
Setup_text is text that includes a printer initialization sequence or other control codes to prepare your printer for printing. If omitted, no setup text is used.
Leftmarg is the size of the left margin measured in characters from the left side of the page. If omitted, it is assumed to be 4.
Rightmarg is the size of the right margin measured in characters from the left side of the page. If omitted, it is assumed to be 76.
Topmarg is the size of the top margin measured in lines from the top of the page. If omitted, it is assumed to be 2.
Botmarg is the size of the bottom margin measured in lines from the bottom of the page. If omitted, it is assumed to be 2.
Pglen is the number of lines on one page. If omitted, it is assumed to be 66 (11 inches with 6 lines per inch). If you're using an HP LaserJet or compatible printer, set pglen to 60 (the printer reserves six lines).
Formatted is a logical value specifying whether to format the output. If TRUE or omitted, the output is formatted; if FALSE, it is not formatted.
Wait is a logical value specifying whether to wait after printing a page. If TRUE, Microsoft Excel waits; if FALSE or omitted, Microsoft Excel continues printing.
 If TRUE, Microsoft Excel prints lines normally; if FALSE or omitted, Microsoft Excel sends an additional line feed character after printing each line.
Port is a number from 1 to 8 specifying which port to use when printing.
| Port | Port used when printing |
| 1 or omitted | LPT1 |
| 2 | COM1 |
| 3 | LPT2 |
| 4 | COM2 |
| 5 | LPT1 |
| 6 | LPT2 |
| 7 | LPT3 |
| 8 | LPT4 |
Update is a logical value specifying whether to update and save global settings. If TRUE, the settings are saved in the EXCEL5.INI file; if FALSE or omitted, the global settings are not saved.
Remarks
The default values for print settings on your worksheet are determined by the current global settings.
Example
The following macro formula prints the currently defined print area to the currently defined printer port:
LINE.PRINT(1)
Related Function
PRINT Prints the active sheet
Return to index