< 132019-01-14⋎15 >

farmOS (farmos.org) is a free and open source, web-based farm management system. User guide: farmos.org/guide/ - Feature requests and bug reports: github.com/farmOS/farmOS/issuesSet by ChanServ on 2018-08-16 at 14:32
00:10*margeo[m] has joined
20:15paul121[m]Okay! I've learned more of the details for a research project our farm is hosting. We are looking at the benefits of fermented feed for chickens. For the study, there are 3 groups of birds that will get different treatments - dry, wet and fermented feed. Under this are 3 replicates (trials) of each group. In total there are 9 separate coops with 10 birds each
20:16paul121[m]Each bird is banded with a unique ID. We are collecting monthly bird weights, daily egg harvests from each coop, and measuring food and water both given and leftover each day.
20:19paul121[m]farmOS already provides a lot of this capability! woo! We can add all the individual birds, and group them hierarchically into their groups. Add observation logs (weight) and harvest logs (eggs) should be quite easy.. I'm looking for ideas for monitoring the feed/water information
20:21paul121[m]Could an observation log (or input log?) be added to a an area (an individual coop) or a group of animals?
20:21mstenta[m]paul121: Awesome! Yea I think most (if not all) of that is doable.
20:22mstenta[m]Re: monitoring feed/water info... I would suggest using Input logs.
20:22mstenta[m]Those can be associated with both areas and assets (the individual animals, or the group)
20:22mstenta[m]And they can have a quantity associated with them
20:23mstenta[m]So you can track quantitative data over time, associated with each group
20:23mstenta[m]You may also want to add a new log category, which you can use to flag logs that are part of the research project
20:23mstenta[m]So you can easily filter down to them in the future (if you are also using farmOS for non-research logging)
20:23mstenta[m]Although maybe that isn't necessary
20:24mstenta[m]I like to think of the "Input" and "Harvest" logs as general-purpose "ins and outs" for any asset
20:24mstenta[m]You put stuff in (food, water, fertilizer, fuel, etc etc) and you get stuff out (harvests, eggs, products, etc)
20:26paul121[m]Great - the input should work then. Quantities will be great for tracking
20:27paul121[m]Adding a special log type could be nice. Creating a quick form would be good too. These can both be done in one module, correct?
20:28mstenta[m]Yea
20:28paul121[m]Following the open source methodology I'm wondering if this could be abstracted. I was thinking of something like a 'Studies' module - perhaps like the 'Plans' module
20:29mstenta[m]Interesting idea... I've actually been talking with sudokita and @gbathree about a "Research farmOS"... thinking through some similar ideas.
20:29paul121[m]A study could be created, a link 'treatment groups' to groups of animals, or even planting. Perhaps other details of a study could be specified and create a 'dashboard' page for analysis
20:30mstenta[m]It might even make sense to use the existing "Plan" entity type - and create a "Research Plan"
20:30mstenta[m]Since "plans" are really just intended to provide a higher-level intentional organization of records around a particular goal
20:31mstenta[m]Although maybe a new entity type would be justified...
20:32paul121[m]Makes sense.. could a module create a "Research Plan" and add special things to that one plan?
20:32mstenta[m]Yea - that's the basic idea for plans... the farm_plan module just provides the entity type itself, but it relies on other modules to provide "Plan Types" (similar to asset types and log types), and additional UI+logic around them
20:32paul121[m]I know the answer to that question, yes. That is what Grazing does.
20:33mstenta[m]Yep :-)
20:33mstenta[m]"Research Plan" might be an interesting case to think through...
20:33mstenta[m]I wonder if a general purpose solution would work...
20:33paul121[m]What would the benefits be of a new entity type?
20:33mstenta[m]Or if you would find that "research" in general varies too much to really pin it down easily
20:34mstenta[m]The benefits of a new entity type would be complete control over how that entity type works...
20:35mstenta[m]That's also the disadvantage... you basically have to replicate everything that farm_asset and farm_plan do, and you would be responsible for maintaining that code moving forward
20:38paul121[m]So it's really a question of what features such a Research 'module' would provide. And what is (bare minimum) required to implement those features?
20:39paul121[m]Keeping the general aspects in mind. Perhaps it's almost an 'Analysis' framework
20:39mstenta[m]yea, and how those features would differ from the existing plan entity type
20:40paul121[m]A way to track specific inputs/harvests across groups of assets, and provide ways to analyze... also ways (quick forms) to collect the data
20:40mstenta[m]Yea that would be great
20:41mstenta[m]The other thing to consider, instead of new entity type, is just adding reporting/analysis features
20:41mstenta[m]Like creating a form that lets you generate a report based on certain criteria
20:41mstenta[m]That wouldn't need to be a separate entity
20:42mstenta[m]You only really need a new entity type if you want to leverage the stuff that Drupal's Entity system provides
20:43mstenta[m]www.drupal.org/docs/7/api/entity-api/an-
20:43mstenta[m]eg: the ability to create sub-types of the entity, with unique fields on each
20:46mstenta[m]It's also possible to simply create your own database tables and manage them without using the Entity stuff from Drupal
20:46mstenta[m]so there are levels of possibility, depending on what you need
20:46paul121[m]So a "Research Plan" would be a sub-type of the "Plan" entity?
20:46mstenta[m]Yea it could be
20:46mstenta[m]Similar to "Grazing Plan"
20:46mstenta[m](on the same level, technically)
20:47paul121[m]Right. I saw you created tables for autofilling the soil disturbance information, yes?
20:47paul121[m](But it just becomes another thing to manage)
20:48mstenta[m]Yea - a module can provide database tables that it is responsible for - so in that case, the farm_soil_nrcs module provides a table that comes prepopulated with STIR operations from NRCS
20:48mstenta[m]Which it then uses to auto-populate the disturbance quick form
20:49mstenta[m](Notably, the module alters itself into the quick form, so if you turn off farm_soil_nrcs, the quick form still works, but doesn't have the STIR operation autocomplete)
20:50paul121[m]The Reporting/Analysis is interesting, too. I like the idea of a form to create a generate report.
20:50mstenta[m]Yea! That's always been something on the horizon in farmOS... reporting/analysis of data
20:51mstenta[m]I'd love to see more reporting features start to come together!
20:51mstenta[m]So maybe you could think through what the reporting requirements are for your purposes... and then think through what it would take to create those in farmOS
20:51mstenta[m]That will help to determine what the best approach is code-wise
20:51paul121[m]On a simpler level, could a "Research Plan" module let you create plans that create their own log type/flag you were talking about?
20:51mstenta[m]Maybe you'll find that you just need some general-purpose reporting
20:52paul121[m]Not only indicate that X asset is a part of research, but it is apart of a specific research plan?
20:52mstenta[m]That isn't even specific to research, but would be useful to anyone using farmOS
20:52mstenta[m]Yea... that's something that we're doing in the Grazing module...
20:52mstenta[m]But I have plans to make it more systematic in farmOS itself
20:53mstenta[m]Right now, the grazing module has a database table that it provides, which keeps certain areas and assets associated with a specific plan
20:53paul121[m]Certainly! Reporting has so many uses..
20:53mstenta[m]But I want to move/generalize some of that logic
20:53mstenta[m]I have some notes/ideas for that jotted down somewhere...
20:54mstenta[m]Essentially: the farm_plan module could provide table(s) itself to maintain the link between a plan and other records
20:54mstenta[m](And then the grazing module could migrate to using that general approach instead of providing it's own specific tables)
20:54paul121[m]Thats great. With that capability, I like the idea of using the Plan entity for "Research Plans" :D
20:55paul121[m](easier to maintain!!)
20:55mstenta[m]yea! generalize and centralize!
20:55mstenta[m]the less code the better ;-)
20:56mstenta[m]Ah here we go... I actually started sketching up some of the code for the farm_plan module...
20:56mstenta[m]github.com/mstenta/farmOS/commit/609f3d1
20:56mstenta[m]That's just a wip (work in progress) commit in my personal fork of farmOS
20:57mstenta[m]It adds some new tables to the farm_plan module, as well as some code to enforce constraints on associated records (so you can't delete a log that's associated with a plan, for instance)
20:57mstenta[m]I believe I have an associated wip commit in the farm_grazing module too...
20:59paul121[m]So a "constraint" is a log/asset that is associated with a plan? The constraint is what protects these from being deleted?
20:59mstenta[m]A "constraint" is a bit more general than that... it's something I implemented in the farm_constraint module to help avoid people deleting records that are associated with other records
21:00mstenta[m]Drupal doesn't really prevent that on it's own
21:00mstenta[m]So if you, for example, have a log with an asset referenced, and you delete the asset: you end up with a log that doesn't reference anything
21:00mstenta[m]farm_constraint prevents that
21:00paul121[m]Oh, so farm_constraint is already in use
21:00mstenta[m]Yea
21:01mstenta[m]So that wip commit starts the process of adding some tables to the farm_plan module for maitaining links between records and plans AND enforcing a constraint so they can't be deleted
21:02mstenta[m]Right now, farm_grazing has similar (but more specific) code for doing that... with regard to areas and assets that are associated with grazing plans
21:03mstenta[m]github.com/mstenta/farm_grazing/blob/7.x
21:03paul121[m]Right. Adding capability for a Plan to use constraints. Okay. I agree, this is important when you start cross referencing things...
21:03mstenta[m]Yea exactly
21:03mstenta[m]You COULD just implement your own constraints in your research plan module...
21:04mstenta[m]But ideally we could generalize that stuff into the farm_plan module
21:04mstenta[m]So neither Grazing nor Research would need to do it themselves
21:05mstenta[m]They would just use some general-purpose helper functions for creating the associations (eg: farm_plan_add_log($plan_id, $log_id) - this doesn't exist, but that's how i'm thinking about doing it basically)
21:05mstenta[m](that's probably not what the function will be called - but you get the idea) :-)
21:06paul121[m]Makes sense! This sounds good.
21:06paul121[m]I'm going to keep brainstorming on "Research Plans" and what capability would be provided there.
21:07paul121[m]Also, think about reporting/analysis. That would be great, too.
21:07mstenta[m]Ok cool! Please feel free to create an issue in GitHub to brainstorm it!
21:07mstenta[m]I know that Ankita and Greg are very interested in similar ideas
21:08paul121[m]Ah yes. Good idea. Will be good to hear their input
21:09paul121[m]Are there any issues concerning reporting/analysis right now?
21:09paul121[m]Perhaps github.com/farmOS/farmOS/issues/48
21:10mstenta[m]Yea that's a good list
21:10mstenta[m]Also just found this one: www.drupal.org/project/farm/issues/23995
21:10mstenta[m]Not a ton of details on any of those...
21:11mstenta[m]You could play around with writing some add-on modules if you want!
21:11*Adam[m]7 has quit (Ping timeout: 268 seconds)
21:11*zackmuma[m] has quit (Ping timeout: 268 seconds)
21:12mstenta[m]eg: modules that can be installed in farmOS, but aren't directly included in farmOS
21:12mstenta[m]Sometimes that's a good way to experiment/refine ideas - and then they can be pulled into farmOS core in the future if it makes sense
21:12*zackmuma[m] has joined
21:13*Adam[m]7 has joined
21:13paul121[m]Cool. Yes, that is what I was thinking
21:13paul121[m]Another question: how do you update modules?
21:21mstenta[m]You can see all the modules that are patched in drupal-org.make
21:21mstenta[m]github.com/farmOS/farmOS/blob/7.x-1.x/dr
21:21mstenta[m]I generally try to make a release of farmOS whenever there is a serious security update to Drupal core or any of the contrib modules we include
21:21mstenta[m]But to answer your actual question: updating modules is simply a matter of replacing the module folder in the codebase, and then running /update.php to execute automated update functions
21:21mstenta[m]If you are developing a module, and you need to make updates to the database in between versions, you can implement hook_update_N() in your modules *.install file
21:21mstenta[m]api.drupal.org/api/drupal/modules%21syst
21:21mstenta[m]Here is a very simple example of that that I just did today:
21:21mstenta[m]github.com/farmOS/farmOS/blob/7.x-1.x/mo
21:27paul121[m]Okay. Starting to understand..
21:27paul121[m]It will make more sense as I have to implement things!
21:28mstenta[m]Yea definitely :-)
21:28mstenta[m]There are lots of great tutorials for Drupal module development online
21:28mstenta[m]And farmOS provides a lot of examples of things to refer to
21:28mstenta[m]There's also a module called "Examples for Developers" for specific Drupal things: drupal.org/project/examples
21:29mstenta[m]Highly recommended
21:32paul121[m]That looks very helpful! Good to have many options to refer to
21:34paul121[m]Appreciate the help and ideas. Will follow up with further questions and findings...
21:34mstenta[m]Awesome good luck paul121 ! Happy to help if you have questions!

< 132019-01-14⋏15 >